cf/mirror

Bracket Walk

CF
1838D2100· master3s256 MB⌨ stdin/stdout

Examples

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