daihan's blog

By daihan, 8 years ago, In English

UPD : Found the bug :)

Hello everyone last day contest problem DIV2 B- not afraid . I solved this problem , One submission with break getting WA on test 10 but test case is too long so cant guess the bug — > WA on test 10 , Submission With break statement .

Another same submission got AC where i just cut the break statement -> GOT AC submission without break statement .

Can not find any short test case which will give the WA for first code .

Here is the diifference : Difference

  • Vote: I like it
  • 0
  • Vote: I do not like it

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

suppose you have total 13 entries and you have got into the if condition on 4th entry and you break from the while loop then there are still 9 entries to scan(input) but you are not scanning them. Next time the scan will scan from the remaining numbers and hence the wrong asnwer.