YouKnowWho.'s blog

By YouKnowWho., history, 5 years ago, In English
In test case 2, for 4th and 7th cases.

input:
3
1 2 5

output:
4th case : NO
7th case : YES

What is going on?? Doesn't make sense.
Please help!

submission link

  • Vote: I like it
  • +5
  • Vote: I do not like it

| Write comment?
»
5 years ago, hide # |
 
Vote: I like it +22 Vote: I do not like it

In this part:

if (n<=2) cout<<"YES";

you need to read in the remaining input, otherwise, the program will read the next test incorrectly. Funny, since I made a very similar mistake...