A Very strange behaviour of the code. Please help!

Revision en1, by robertlewantest, 2024-01-24 17:22:25

Here are my 2 submissions for the problem — https://codeforces.net/contest/1541/problem/B 43140452 -1 243140165 -2

Only difference between the two is the if condition — in first if(l<r and var==(l+r) and in second if(l<r and var%(l+r)==0 and (var/(l+r))==1)

Ideally both should produce same result but on test 103 it is failing - The test 103 is this 1 4 5 2 4 1

its answer should be 1 and indeed its 1 when i run in local or custom invoction but on submit it is giving WA

Can someone pls help why is behaviour?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English robertlewantest 2024-01-24 17:26:20 4 Tiny change: 'ion:243140165] -2\n\nOn' -> 'ion:243140452] -2\n\nOn'
en4 English robertlewantest 2024-01-24 17:25:22 5 Tiny change: 'ubmission:43140452] -1\n[sub' -> 'ubmission:243140165] -1\n[sub'
en3 English robertlewantest 2024-01-24 17:24:18 19
en2 English robertlewantest 2024-01-24 17:23:31 5 Tiny change: ' is this\n1\n4\n5 2 4 1\n\' -> ' is this\n\nn=4\na=5 2 4 1\n\'
en1 English robertlewantest 2024-01-24 17:22:25 619 Initial revision (published)