silentfox's blog

By silentfox, 4 years ago, In English

In the Educational Codeforces Round 92 (Rated for Div. 2) a submission of mine got hacked. https://codeforces.net/contest/1389/submission/88356909 . I got TLE.

But now when the hacking test case has been added to the system's test cases, my exact same solution passes the test case which hacked it originally. https://codeforces.net/contest/1389/submission/88406162

I also checked out a lot of solutions from other participants who used exactly the same approach, but they also passed the hacking test case.

I know that my solution takes time very close to the allowed time, but the inconsistency puzzles me. Can this be reported somewhere, the solution should either be marked hacked, or accepted.

MikeMirzayanov awoo

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

»
4 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Your solution passed in $$$1980$$$. That is a critical pass. If you used fast input/output and tried to optimize that long long to int, you probably would have passed in main system testing/hacking.

Edit: the above improvements will make your time execution less. But the major issue is that you keep resetting the whole DP. What if there are many testcases? Declare the DP as a global variable and clear only from 0 to $$$n$$$ instead from $$$0$$$ to $$$10^5$$$

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

    Thank you for your suggestions. They are very helpful.

    However, my concern is that the case which hacked my solution gets executed in around 1915 ms (for everyone with almost the same solution and also for me now). But that one time when the submission was hacked it generated a TLE (took 2000 ms).

    Also, the system re-ran the hacking test case for all solutions after the open hacking phase ended. But as of now, it does not re-runs the test case for hacked solutions, where I am hoping that the behaviour with my submission would have changed.

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

      I feel sorry for you. As I remember, CF re-runs solution for 3 more trials just to make sure it passes and it is not a slowness in the server. I am not sure if this happens in hacking or not. But it seems like it doesn't?(Not sure)