Error in understanding output of div2 round 548 Problem C

Revision en1, by dunjen_master, 2019-03-21 22:40:50

Her is the link to my submission on which i got WA at pretest 11 https://codeforces.com/contest/1139/submission/51643042

I just uncommented the line ans=(ans+mod)%mod and it got accpeted although in the previous line i had done ans=(? -ans +mod)%mod.

Someone please explain me why did my code failed at test 11 ?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English dunjen_master 2019-03-21 22:40:50 377 Initial revision (published)