QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#877258#8987. Colorful TreesZhangYiDeWA 1ms5872kbC++202.5kb2025-01-31 20:39:062025-01-31 20:39:12

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 5864kb

input:

6
3
1
2
1
2
2
2 6
4 5
1 4
3 4
1 2

output:

2
2
3
2
3

result:

ok 5 lines

Test #2:

score: 0
Accepted
time: 0ms
memory: 5856kb

input:

4
2
2
2
2
3 4
2 4
1 2

output:

3
4
3

result:

ok 3 lines

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 5872kb

input:

1000
434
434
434
434
884
434
711
711
711
434
711
434
711
711
434
711
711
434
884
884
434
884
884
434
434
434
884
711
884
884
884
711
711
434
884
884
884
434
884
711
711
884
434
434
884
884
434
884
711
711
434
434
711
711
711
434
711
434
711
434
434
434
434
434
711
434
711
711
434
434
711
711
884
884...

output:

330
330
980
330
671
326
341
658
341
341
330
1336
656
326
656
999
330
1017
330
2973
330
1352
330
1302
656
326
330
341
972
330
330
650
330
330
1006
1338
330
341
326
671
326
1673
326
326
341
330
341
2584
341
330
1610
667
330
2325
341
341
671
326
671
984
1678
341
2654
326
667
680
326
341
326
1321
1336
9...

result:

wrong answer 3rd lines differ - expected: '83135', found: '980'