Блог пользователя mbstu_nitai

Автор mbstu_nitai, история, 6 лет назад, По-английски

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.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +10
  • Проголосовать: не нравится

Автор mbstu_nitai, история, 6 лет назад, По-английски

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

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. :)

Полный текст и комментарии »

  • Проголосовать: нравится
  • +18
  • Проголосовать: не нравится