nanu's blog

By nanu, history, 7 years ago, In English

During the round Codeforces Round 407 (Div. 2) I used the following generator code to hack this solution 25904282 for this problem 789A - Анастасия и камушки

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

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

»
7 years ago, # |
  Vote: I like it +27 Vote: I do not like it
»
7 years ago, # |
  Vote: I like it +3 Vote: I do not like it

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.

  • »
    »
    7 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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

    • »
      »
      »
      7 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      If the contest is not educational, just hack again, you are likely to get it.