Flag of Berland
837B1600· expert1s256 MB⌨ stdin/stdout
Examples
Sample 1of 4
Input
6 5RRRRRRRRRRBBBBBBBBBBGGGGGGGGGG
Output
YES
Sample 2of 4
Input
4 3BRGBRGBRGBRG
Output
YES
Sample 3of 4
Input
6 7RRRGGGGRRRGGGGRRRGGGGRRRBBBBRRRBBBBRRRBBBB
Output
NO
Sample 4of 4
Input
4 4RRRRRRRRBBBBGGGG
Output
NO
58%
837B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)