What I'am missing in my solution?

Revision en1, by ekiauhce, 2021-07-25 11:47:00

I have troubles with this problem 1438B - Валерий против всех.

As i figured out, we need to check if all numbers of the array are distinct and print "NO". Otherwise, print "YES".

So, when we iterating over all numbers we can just stop after finding non-disctinct integer. But this approach fails on 2-nd test and I don't know why. 123681639

Though, solution which compares size of set and n works pretty good. 123682623

Please, tell me what I'm missing.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English ekiauhce 2021-07-25 11:47:00 513 Initial revision (published)