cf/mirror

DBFS Order (Hard Version)

CF
2237I23500· legendary gm2s1024 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
10
4
1??
2 2 3
0
1 4
0
6
?????
5 2 3 4 5 6
0
0
0
0
0
12
?????1?010?
1 11
2 8 3
3 9 12 6
0
1 4
0
1 10
0
1 5
0
2 2 7
0
2
1
1 2
0
5
1?0?
1 2
1 3
1 4
1 5
0
5
1111
4 2 3 4 5
0
0
0
0
3
??
2 2 3
0
0
5
1???
2 2 3
2 4 5
0
0
0
7
?1?0??
2 2 3
2 4 5
2 6 7
0
0
0
0
8
1?0??1?
3 2 3 4
2 5 6
1 7
0
0
1 8
0
0
Output
3
27
88
1
1
1
2
6
8
14
2237I2.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…