mbstu_nitai's blog

By mbstu_nitai, history, 6 years ago, In English

ID 1: See this coderorces ID ID1 This id was opened just before the contest.

ID 2: See this id also ID2

ID 3: See this id also ID3

ID2 and ID3 hacked 20 times of ID 1's solutions. All the submissions are similar. See the solutions Hacked submissions

I think it's cheating in codeforces. I think it will put a question towards codeforces. Hope codeforces authority will take proper steps for this cheating.

Thank you.

Full text and comments »

  • Vote: I like it
  • +10
  • Vote: I do not like it

By mbstu_nitai, history, 6 years ago, In English

=====================================================================

What are the differences between this three sort functions in Mo's algo?

First approach:

bool comp(stt q1, stt q2)
{
    int block_a = q1.l / sq, block_b = q2.l / sq;
    if(block_a == block_b)
        return q1.r < q2.r;
    return block_a < block_b;
}

Second approach:

bool comp(stt q1, stt q2)
{
  if (q1.l / sq != q2.l / sq) 
     return q1.l< q2.l;
  return (q1.r < q2.r)^(q1.l/sq%2);
}

Third approach:

bool comp(stt q1, stt q2)
{
    if(q1.l/sq != q2.l/sq)
    {
        return q1.l < q2.l;
    }
    if((q1.l/sq) & 1)
    {
        return q1.r < q2.r;
    }
    return q1.r > q2.r;
}

Problem link

The first approach gives the TLE on test 9 Submission link the second approach gives the TLE on test 67 Submission link but the third approach gives AC Submission link . Thanks in advance. :)

Full text and comments »

  • Vote: I like it
  • +18
  • Vote: I do not like it