QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#877180#8987. Colorful TreesHuangHanShengWA 2ms12252kbC++231.3kb2025-01-31 20:09:462025-01-31 20:09:48

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 2ms
memory: 12204kb

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: 1ms
memory: 12252kb

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
81835
2978
671
326
341
658
341
341
330
1334
2959
326
656
81989
330
1017
17514
28514
330
6556
330
2610
3284
326
1325
341
15435
330
330
650
330
999
1006
3296
1311
341
996
671
326
42512
1330
326
341
330
3633
42217
341
4594
11507
667
984
6529
10998
341
4919
326
671
982
1676
341
10938
326
1320
13...

result:

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