cf/mirror

Is This a Zebra?

CF
926C1700· expert1s256 MB⌨ stdin/stdout

Examples

Sample 1of 5
Input
9
0 0 0 1 1 1 0 0 0
Output
YES
Sample 2of 5
Input
7
0 0 0 1 1 1 1
Output
NO
Sample 3of 5
Input
5
1 1 1 1 1
Output
YES
Sample 4of 5
Input
8
1 1 1 0 0 0 1 1
Output
NO
Sample 5of 5
Input
9
1 1 0 1 1 0 1 1 0
Output
NO
926C.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)