409129: GYM103443 G The Treasure of the Sierra Jade

Memory Limit:1024 MB Time Limit:0 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

G. The Treasure of the Sierra Jadetime limit per test1.0 smemory limit per test1024 megabytesinputstandard inputoutputstandard outputExampleInput
5
2 3
1 2
1 2
0 0
0 0
1
3 0 1 1 1 1 1
2 3
1 2
1 2
0 0
0 0
1
2 0 1 1 1
2 3
1 2
1 2
0 0
1 0
0
2 3
1 2
1 2
0 0
1 0
2
1 0 1
1 1 1
3 3
1 2 1
1 1 1
0 2 0
1 0
1
3 0 1 1 1 2 1
Output
3
-1
2
-1
3

加入题单

上一题 下一题 算法标签: