cf/mirror

Blue-Red Permutation

CF
1607D1300· pupil1s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
8
4
1 2 5 2
BRBR
2
1 1
BB
5
3 1 4 2 5
RBRRB
5
3 1 3 1 3
RBRRB
5
5 1 5 1 5
RBRRB
4
2 2 2 2
BRBR
2
1 -2
BR
4
-2 -1 4 0
RRRR
Output
YES
NO
YES
YES
NO
YES
YES
YES
1607D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)