cf/mirror

Chain Queries

CF
1975E2100· master2s256 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
2
2 1
1 0
1 2
1
5 4
1 0 0 0 0
1 2
1 3
1 5
3 4
4
3
2
5
Output
No
No
Yes
Yes
No
Sample 2of 2
Input
4
5 3
1 1 1 1 1
3 5
2 5
3 4
1 5
1
1
1
4 4
0 0 0 0
1 2
2 3
1 4
1
2
3
2
1 1
1
1
1 1
0
1
Output
Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
1975E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…