Блог пользователя YouKnowWho.

Автор YouKnowWho., история, 5 лет назад, По-английски
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

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +22 Проголосовать: не нравится

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...