cf/mirror

The Door Problem

CF
776D2000· candidate master2s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
3 3
1 0 1
2 1 3
2 1 2
2 2 3
Output
NO
Sample 2of 3
Input
3 3
1 0 1
3 1 2 3
1 2
2 1 3
Output
YES
Sample 3of 3
Input
3 3
1 0 1
3 1 2 3
2 1 2
1 3
Output
NO
776D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…