cf/mirror

QED's Favorite Permutation

CF
2030D1700· expert2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
3
5 3
1 4 2 5 3
RLRLL
2
4
3
8 5
1 5 2 4 8 3 6 7
RRLLRRRL
4
3
5
3
4
6 2
1 2 3 4 5 6
RLRLRL
4
5
Output
YES
YES
NO
NO
YES
NO
NO
NO
YES
YES
2030D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)