QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#599575#5148. Tree DistancemaxrgbyTL 1ms5804kbC++203.3kb2024-09-29 06:50:102024-09-29 06:50:10

详细

Test #1:

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

input:

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

output:

-1
3
7
7
2

result:

ok 5 number(s): "-1 3 7 7 2"

Test #2:

score: -100
Time Limit Exceeded

input:

199999
31581 23211 322548833
176307 196803 690953895
34430 82902 340232856
36716 77480 466375266
7512 88480 197594480
95680 61864 679567992
19572 14126 599247796
188006 110716 817477802
160165 184035 722372640
23173 188594 490365246
54801 56250 304741654
10103 45884 643490340
127469 154479 214399361...

output:

199999 199999 443019 1
199999 199999 112940 1
199999 199999 382453 1
199999 199999 202500 1
199999 199999 634535 1
199999 199999 618897 1
199998 199999 8810696855463 0
199998 199998 601522 1
199998 199999 477258 1
199998 199999 550973 1
199998 199999 913913 1
199997 199998 2794343162587 0
199997 199...

result: