Can someone tell me why my code failed in first case and passes in second case

Revision en1, by athu18, 2021-10-03 21:00:30

During the contest I used Array of Integer type to avoid TLE, which can occur with array of primitive ints but that led to wrong answer but after I tried with array of primitives and I got AC. Can someone tell me why this is happening?

Submission 1: WA (https://codeforces.com/contest/1592/submission/130698133)

Submission 2: AC (https://codeforces.com/contest/1592/submission/130727745)

Tags help

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English athu18 2021-10-03 21:00:30 477 Initial revision (published)