xrisk's blog

By xrisk, history, 8 years ago, In English

During today’s round, a bug occurred where someone else’s code was submitted as mine. Specifically, it was this submission — http://codeforces.com/contest/618/submission/15652895 While submitting, I chose the language as Python 3, and it gave a compile error on last line.

I submitted again with my code, and this time it worked.

  • Vote: I like it
  • -16
  • Vote: I do not like it

»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Why so many down votes?

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

    Because the situation is unclear: the code you linked is wrong in Python 3 on the last line, and you haven't provided link to the second submission when "it worked". I do not see any submissions of same (or similar) code.

    It looks to me like you've sent completely different code the second time while thinking it was the same code.

    • »
      »
      »
      8 years ago, # ^ |
      Rev. 2   Vote: I like it +15 Vote: I do not like it

      Ok I will try to explain it more clearly.

      According to submission history, I submitted on problem A three times.

      You can see that my first submission was slightly wrong, and it failed on pretest 3. You can see that this first submission was valid Python3 .

      Then I fixed the bug, and submitted it for SECOND time (Here is a picture of the code on my computer as I submitted second time — http://imgur.com/TZfqCG1

      However, the code that the system received was COMPLETELY different. It is not even valid Python3, and it uses a different approach.

      Anyway, my second submission gave me a Compile Error, which was strange to me during the contest because the code was perfect.

      I submitted the SAME code for a third time, and it gave me AC. You can see that the third submission actually contains MY code (the structure of the code is similar to my first submission.)

      The question is how Codeforces system received entirely different code to what I submitted. How did the submissions get mixed up? The second submission obviously contains someone else’s written code.

      Hope I have been able to explain myself.

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

        Ok, that makes much more sense now.

        What was the method you used for submitting? Was it copy-paste to text field or file selection? If the latter, is it possible that you've accidentally selected wrong file or the file was changed between you selecting it and you clicking the "Submit" button? In any case, I would advise you to update your original post and contact MikeMirzayanov — he will probably be able to look it up in logs or something. I think that you accidentally chose wrong file.

        The code does not look like it belongs to Wunderfund contest at all — it's some range query problem where you either reverse or sort sub-arrays of an array.