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

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

During the round Codeforces Round 407 (Div. 2) I used the following generator code to hack this solution 25904282 for this problem 789A - Anastasia and pebbles

printf("100000 1\n");
for(i=0;i<100000-1;i++)
{
    printf("%d ",10000);
}
printf("%d",10000);
printf("\n");

Unfortunately, the attempt became unsuccessful as the solution produced the output in 998 ms. Later during the system tests, the same solution gave a TLE on the exact same test case — Test Case #27

Was that just bad luck? :P

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

»
8 лет назад, # |
  Проголосовать: нравится +27 Проголосовать: не нравится
»
8 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

You should have run custom invocation a few times to compute the average running time of the submission. Then, if it were more that 1000 ms, you should have just tried hacking again, as chances were with you.

  • »
    »
    8 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Good idea, but you can't just copy the other contestant's code to the custom invocation window during the contest.

    Moreover, it seems quite obvious that 5*10^8 solution reading with cin should get TL