basket_full's blog

By basket_full, history, 2 months ago, In English

When I copy someone else's code and then submit the code it says "Wrong answer". But the same code says "Accepted" on the other's submission. Why does it happens?

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

»
2 months ago, # |
  Vote: I like it +11 Vote: I do not like it

How somebody supposed to help without something more concrete? Something obvious reasons:

  1. Mistake in copy-paste (I don't know how but I think it's possible)
  2. Mistake in problem (AC code solves different problem — maybe confusing with Div1/Div2 literas)
  3. UB in code then accepted code' author was just lucky.
  4. Since no one submission has been showed maybe it all was just hypotetical question.
»
2 months ago, # |
  Vote: I like it +4 Vote: I do not like it

This question is too generic to provide an accurate answer. Some possible reasons include Undefined Behaviour and randomizations in the algorithm you copied.