QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#775709#1974. Black Family TreeMaMengQiRE 0ms3576kbC++201.7kb2024-11-23 16:32:042024-11-23 16:32:05

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3576kb

input:

6 5
1 2 4 8 16 32
1 2 2 1 5
1 1
2 3
4 5
2 6
6 6

output:

63
14
56
62
32

result:

ok 5 lines

Test #2:

score: -100
Runtime Error

input:

5 25
4723 3513 2046 6286 9584
1 2 2 1
1 5
5 5
2 3
2 3
4 4
2 4
2 2
1 2
2 5
3 3
2 2
1 3
2 4
1 5
2 2
3 3
3 5
2 5
1 3
1 5
2 3
4 5
4 4
4 4
1 3

output:


result: