QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#412355#1490. Road ClosuresSimonLJK#12 28ms8076kbC++201.8kb2024-05-16 12:21:042024-05-16 12:32:14

Judging History

你现在查看的是最新测评结果

  • [2024-05-16 12:32:14]
  • 管理员手动重测该提交记录
  • 测评结果:12
  • 用时:28ms
  • 内存:8076kb
  • [2024-05-16 12:21:04]
  • 提交

answer

#include "roads.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std; 
typedef long long ll;
const ll inf=1e14;
const int N=1e5+99;
ll f[N],g[N],cnt[N];
struct edge{
	int v,w,nxt;
}edg[N*2];
int hd[N],cntedge;
void add(int u,int v,int w){
	cntedge++;
	edg[cntedge]=(edge){v,w,hd[u]};
	hd[u]=cntedge;
}
void dfs(int u,int fa,int res){
	priority_queue<ll> que;
	g[u]=f[u]=0;
	ll v,w;
	for(int i=hd[u];i;i=edg[i].nxt){
		v=edg[i].v; w=edg[i].w;
		if(v==fa) continue;
		dfs(v,u,res);
		f[u]+=f[v]; g[u]+=f[v];
		que.push(-(g[v]+w-f[v]));
	}
	ll now;
	for(int i=1;i<=cnt[u]-res-1;i++){
		now=que.top(); que.pop(); now=-now;
		f[u]+=now; g[u]+=now;
	}
	if(cnt[u]-res>=1){
		if(que.empty()) f[u]=inf;
		else{
			now=que.top(); que.pop(); now=-now;
			f[u]+=now; g[u]+=min(now,0ll);
		}
	};
	while(!que.empty()){
		now=que.top(); que.pop(); now=-now;
		f[u]+=min(now,0ll); g[u]+=min(now,0ll);
	}
	return;
}
std::vector<long long> minimum_closure_costs(int n, std::vector<int> u,
                                             std::vector<int> v,
                                             std::vector<int> w) {
	vector<ll> re;
	re.resize(n);
	int b1=1,b2=1;
    for(int i=0;i<=n-2;i++){
    	if(u[i]!=0) b1=0;
    	if(u[i]!=i||v[i]!=i+1) b2=0;
	}
	if(b1){
		sort(w.begin(),w.end());
		for(int i=n-2;i>=0;i--)
			re[i]=re[i+1]+w[n-2-i];
	}
	else if(b2){
		for(int i=0;i<=n-2;i++) re[0]+=w[i];
		for(int i=1;i<=n-1;i++){
			f[i]=g[i-1];
			g[i]=(ll)w[i-1]+min(g[i-1],f[i-1]);
		}
		re[1]=min(f[n-1],g[n-1]);
	}
	else if(N<=2000){
		for(int i=0;i<=n-2;i++){
			add(u[i],v[i],w[i]); add(v[i],u[i],w[i]);
			cnt[u[i]]++; cnt[v[i]]++; 
		}
		for(int i=0;i<=n-1;i++){
			dfs(0,-1,i);
			re[i]=f[0];
		}
	}
	return re;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 1ms
memory: 3812kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
2000
0 559 717769868
0 237 766447943
0 122 517523402
0 1779 560381127
0 1477 566064983
0 67 303410673
0 1869 605544497
0 1769 774963386
0 457 469996896
0 201 995323973
0 1694 885366346
0 1547 362843462
0 55 947026157
0 1302 448837561
0 733 673028958
0 1139 65...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
1239932930636 1238933034699 1237933274404 1236933811304 1235934429141 1234937111512 1233940392882 1232944051225 1231948294381 1230952540572 1229957216599 1228962389458 1227967672340 1226973261544 1225980503037 1224988213004 1223996200036 1223004619782 1222...

result:

ok 3 lines

Test #2:

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

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
2000
0 1442 1000000000
0 1429 1000000000
0 446 1000000000
0 149 1000000000
0 1530 1000000000
0 527 1000000000
0 859 1000000000
0 297 1000000000
0 1575 1000000000
0 900 1000000000
0 1792 1000000000
0 1962 1000000000
0 1566 1000000000
0 1372 1000000000
0 1538 1...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
1999000000000 1998000000000 1997000000000 1996000000000 1995000000000 1994000000000 1993000000000 1992000000000 1991000000000 1990000000000 1989000000000 1988000000000 1987000000000 1986000000000 1985000000000 1984000000000 1983000000000 1982000000000 1981...

result:

ok 3 lines

Test #3:

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

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
136
0 120 700717317
0 123 718572676
0 132 959462853
0 107 530118580
0 9 969226913
0 82 871844182
0 84 845338769
0 65 892873084
0 128 633096137
0 42 505691290
0 62 551920432
0 69 901803199
0 71 543402077
0 22 684844125
0 38 696996987
0 108 824527065
0 58 70901...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
99836216760 98851977125 97870361891 96897562987 95925870841 94956643928 93989200634 93027802434 92068339581 91108999837 90153109803 89203933069 88257991949 87313068234 86374187295 85435928745 84501934377 83572524493 82645816813 81733435400 80822405308 7991...

result:

ok 3 lines

Test #4:

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

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
200
0 77 391886950
0 57 553091833
0 80 906348882
0 40 506652307
0 184 338560594
0 87 380862436
0 170 684734760
0 191 857396956
0 27 637257239
0 185 529164085
0 33 458571287
0 133 769321525
0 41 671206065
0 166 200260384
0 189 210065789
0 23 512103998
0 18 622...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
100983628068 99984459468 98998058529 98013796639 97032988739 96054503035 95078925288 94109019082 93145666200 92183527659 91225019525 90269487976 89324715876 88404499721 87495915174 86589566292 85686021041 84789119369 83893847847 82999595315 82140298258 812...

result:

ok 3 lines

Test #5:

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

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
200
0 194 1000000000
0 127 1000000000
0 165 1000000000
0 93 1000000000
0 103 1000000000
0 27 1000000000
0 77 1000000000
0 7 1000000000
0 15 1000000000
0 1 1000000000
0 173 1000000000
0 149 1000000000
0 86 1000000000
0 67 1000000000
0 133 1000000000
0 75 10000...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
199000000000 198000000000 197000000000 196000000000 195000000000 194000000000 193000000000 192000000000 191000000000 190000000000 189000000000 188000000000 187000000000 186000000000 185000000000 184000000000 183000000000 182000000000 181000000000 180000000...

result:

ok 3 lines

Test #6:

score: 0
Accepted
time: 1ms
memory: 4164kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
1685
0 416 6
0 1238 7
0 1121 5
0 192 9
0 308 5
0 948 7
0 762 7
0 1413 10
0 214 7
0 1607 7
0 376 5
0 1169 7
0 385 7
0 150 9
0 542 10
0 50 10
0 1206 6
0 434 7
0 618 5
0 768 10
0 1355 6
0 1561 8
0 121 5
0 1011 10
0 1150 9
0 1230 10
0 1372 8
0 536 10
0 1000 6
0 7...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
12587 12577 12567 12557 12547 12537 12527 12517 12507 12497 12487 12477 12467 12457 12447 12437 12427 12417 12407 12397 12387 12377 12367 12357 12347 12337 12327 12317 12307 12297 12287 12277 12267 12257 12247 12237 12227 12217 12207 12197 12187 12177 1216...

result:

ok 3 lines

Test #7:

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

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
2000
0 1639 4
0 905 3
0 1918 7
0 1730 6
0 792 5
0 275 5
0 79 6
0 1555 3
0 1679 7
0 777 9
0 1790 10
0 1749 3
0 1430 4
0 1091 7
0 1598 8
0 738 10
0 342 6
0 1454 7
0 933 5
0 252 2
0 762 8
0 1224 4
0 156 5
0 227 10
0 791 3
0 1183 3
0 1937 10
0 1279 9
0 1773 4
0 1...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
10930 10920 10910 10900 10890 10880 10870 10860 10850 10840 10830 10820 10810 10800 10790 10780 10770 10760 10750 10740 10730 10720 10710 10700 10690 10680 10670 10660 10650 10640 10630 10620 10610 10600 10590 10580 10570 10560 10550 10540 10530 10520 1051...

result:

ok 3 lines

Test #8:

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

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
188
0 73 7
0 161 7
0 172 10
0 88 8
0 180 9
0 81 7
0 28 8
0 92 8
0 57 7
0 66 10
0 108 8
0 156 10
0 142 8
0 65 6
0 130 6
0 166 6
0 132 7
0 43 7
0 87 7
0 171 8
0 53 5
0 151 9
0 68 5
0 37 8
0 67 9
0 99 5
0 15 5
0 148 10
0 31 7
0 46 8
0 23 5
0 162 5
0 168 6
0 136 ...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
1376 1366 1356 1346 1336 1326 1316 1306 1296 1286 1276 1266 1256 1246 1236 1226 1216 1206 1196 1186 1176 1166 1156 1146 1136 1126 1117 1108 1099 1090 1081 1072 1063 1054 1045 1036 1027 1018 1009 1000 991 982 973 964 955 946 937 928 919 910 901 892 883 874 ...

result:

ok 3 lines

Test #9:

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

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
200
0 40 10
0 17 9
0 71 8
0 61 3
0 126 5
0 47 1
0 64 8
0 128 6
0 25 2
0 168 5
0 196 1
0 75 3
0 177 9
0 190 8
0 197 3
0 97 10
0 19 2
0 187 8
0 48 1
0 4 9
0 154 4
0 94 5
0 141 6
0 68 8
0 143 5
0 5 8
0 172 2
0 155 1
0 112 7
0 72 1
0 33 8
0 127 8
0 101 9
0 108 3
...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
1110 1100 1090 1080 1070 1060 1050 1040 1030 1020 1010 1000 990 980 970 960 950 940 930 920 911 902 893 884 875 866 857 848 839 830 821 812 803 794 785 776 767 758 749 740 731 722 714 706 698 690 682 674 666 658 650 642 634 626 618 610 602 594 586 578 570 ...

result:

ok 3 lines

Test #10:

score: 0
Accepted
time: 8ms
memory: 4952kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
60145
0 38832 8
0 33327 7
0 10015 8
0 32059 7
0 2920 8
0 25980 10
0 12777 6
0 49541 10
0 16526 9
0 31021 10
0 43794 7
0 2769 5
0 27040 5
0 57465 10
0 7213 6
0 5285 6
0 17505 9
0 38268 8
0 39509 5
0 33647 5
0 43349 6
0 16916 5
0 52054 7
0 34160 6
0 19654 5
0 5...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
450282 450272 450262 450252 450242 450232 450222 450212 450202 450192 450182 450172 450162 450152 450142 450132 450122 450112 450102 450092 450082 450072 450062 450052 450042 450032 450022 450012 450002 449992 449982 449972 449962 449952 449942 449932 4499...

result:

ok 3 lines

Test #11:

score: 0
Accepted
time: 20ms
memory: 6288kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
100000
0 64607 7
0 42385 10
0 44292 9
0 97403 1
0 42195 1
0 70381 3
0 68569 6
0 93180 5
0 31137 7
0 70116 6
0 96244 1
0 54751 8
0 72471 5
0 94446 6
0 30081 6
0 16107 2
0 73322 5
0 57820 10
0 8737 10
0 1185 2
0 54617 10
0 25921 4
0 44736 9
0 1962 3
0 21198 7
0...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
548703 548693 548683 548673 548663 548653 548643 548633 548623 548613 548603 548593 548583 548573 548563 548553 548543 548533 548523 548513 548503 548493 548483 548473 548463 548453 548443 548433 548423 548413 548403 548393 548383 548373 548363 548353 5483...

result:

ok 3 lines

Test #12:

score: 0
Accepted
time: 25ms
memory: 6104kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
88851
0 40855 622714961
0 70076 701675758
0 55790 799992272
0 61987 545931423
0 86704 840742298
0 55912 528364653
0 37463 965102567
0 55688 624240495
0 74198 725625072
0 74289 755182409
0 13771 908523605
0 28737 837964967
0 43690 894939556
0 71518 822608357
0...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
66749858652979 66748858659468 66747858675656 66746858693735 66745858724395 66744858762460 66743858801493 66742858841393 66741858883656 66740858935748 66739858988563 66738859041617 66737859106551 66736859173429 66735859245980 66734859319091 66733859397067 6...

result:

ok 3 lines

Test #13:

score: 0
Accepted
time: 27ms
memory: 6276kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
98551
0 64477 789693210
0 75849 919904246
0 5858 334810540
0 1992 899129859
0 25751 816351530
0 45047 764387162
0 14638 919517781
0 94241 749903186
0 96141 569237013
0 53416 848711927
0 12118 115232734
0 36645 591518010
0 26163 831171118
0 37195 597674568
0 2...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
49310888429811 49309888439578 49308888451477 49307888503541 49306888573521 49305888653275 49304888758903 49303888906551 49302889066290 49301889227025 49300889389284 49299889567710 49298889752463 49297889937436 49296890128547 49295890334377 49294890542751 4...

result:

ok 3 lines

Test #14:

score: 0
Accepted
time: 28ms
memory: 6356kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
100000
0 51885 561502960
0 79618 679798313
0 88404 698369677
0 82752 717251049
0 36763 765605128
0 71714 914255275
0 84778 693567588
0 76892 797931295
0 57322 745927626
0 46961 860782160
0 58841 494039244
0 26464 944951246
0 44554 696825163
0 84294 466009891
...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
66717828864117 66716828868457 66715828879614 66714828891996 66713828926388 66712828962436 66711829002326 66710829044021 66709829089618 66708829137386 66707829188710 66706829243094 66705829307976 66704829378460 66703829454208 66702829530079 66701829608227 6...

result:

ok 3 lines

Test #15:

score: 0
Accepted
time: 23ms
memory: 6360kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
100000
0 41763 1000000000
0 98405 1000000000
0 8801 1000000000
0 65884 1000000000
0 5569 1000000000
0 74331 1000000000
0 86457 1000000000
0 39267 1000000000
0 67218 1000000000
0 17626 1000000000
0 93891 1000000000
0 24509 1000000000
0 39861 1000000000
0 89041...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
99999000000000 99998000000000 99997000000000 99996000000000 99995000000000 99994000000000 99993000000000 99992000000000 99991000000000 99990000000000 99989000000000 99988000000000 99987000000000 99986000000000 99985000000000 99984000000000 99983000000000 9...

result:

ok 3 lines

Test #16:

score: 0
Accepted
time: 17ms
memory: 6112kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
90409
0 66184 1
0 47848 1
0 62608 1
0 36158 1
0 74174 1
0 13866 1
0 46156 1
0 17074 1
0 12804 1
0 74594 1
0 17874 1
0 27433 1
0 17723 1
0 43913 1
0 71447 1
0 80816 1
0 31782 1
0 34144 1
0 53165 1
0 12232 1
0 68107 1
0 24045 1
0 83199 1
0 11635 1
0 28304 1
0 5...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
90408 90407 90406 90405 90404 90403 90402 90401 90400 90399 90398 90397 90396 90395 90394 90393 90392 90391 90390 90389 90388 90387 90386 90385 90384 90383 90382 90381 90380 90379 90378 90377 90376 90375 90374 90373 90372 90371 90370 90369 90368 90367 9036...

result:

ok 3 lines

Test #17:

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

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
2
0 1 4

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
4 0

result:

ok 3 lines

Test #18:

score: 0
Accepted
time: 1ms
memory: 3952kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
1881
0 863 733310362
0 749 620592065
0 439 941355812
0 247 917114917
0 780 618208487
0 1089 839140158
0 306 574874450
0 1469 722372298
0 895 523918638
0 814 947179614
0 1833 626745535
0 510 909955698
0 142 647435145
0 996 801388995
0 1374 546723246
0 1078 728...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
1413341451956 1412341597349 1411342001784 1410342741854 1409343657707 1408345535592 1407347701767 1406350003446 1405352621656 1404355250390 1403357882901 1402360583868 1401363285085 1400366132832 1399369805765 1398374108047 1397378956465 1396384178900 1395...

result:

ok 3 lines

Subtask #2:

score: 7
Accepted

Test #19:

score: 7
Accepted
time: 0ms
memory: 3820kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
2
0 1 4

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
4 0

result:

ok 3 lines

Test #20:

score: 0
Accepted
time: 15ms
memory: 7104kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
82978
0 1 687749865
1 2 811016969
2 3 502155590
3 4 930576294
4 5 879987412
5 6 883450944
6 7 975772046
7 8 739249697
8 9 954502114
9 10 962223056
10 11 562948742
11 12 933819577
12 13 614418299
13 14 724040317
14 15 798630312
15 16 583709944
16 17 634442427
...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
62302380746314 30279591664360 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 3 lines

Test #21:

score: 0
Accepted
time: 21ms
memory: 7596kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
93546
0 1 290395864
1 2 691792065
2 3 835413884
3 4 710017326
4 5 260033127
5 6 653931538
6 7 436315036
7 8 457880361
8 9 309935199
9 10 852772849
10 11 514034846
11 12 383007265
12 13 382658811
13 14 360592330
14 15 393423735
15 16 96114953
16 17 372806844
1...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
46896508581910 19411729586291 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 3 lines

Test #22:

score: 0
Accepted
time: 11ms
memory: 8076kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
100000
0 1 535716508
1 2 834689223
2 3 936888828
3 4 622366241
4 5 708605912
5 6 758421977
6 7 943752359
7 8 532568340
8 9 660522341
9 10 526589282
10 11 407223876
11 12 396491315
12 13 803568283
13 14 555205600
14 15 725646618
15 16 373592297
16 17 980551825...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
66701059031889 31442955862629 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 3 lines

Test #23:

score: 0
Accepted
time: 15ms
memory: 7940kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
100000
0 1 1000000000
1 2 1000000000
2 3 1000000000
3 4 1000000000
4 5 1000000000
5 6 1000000000
6 7 1000000000
7 8 1000000000
8 9 1000000000
9 10 1000000000
10 11 1000000000
11 12 1000000000
12 13 1000000000
13 14 1000000000
14 15 1000000000
15 16 1000000000...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
99999000000000 49999000000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 3 lines

Test #24:

score: 0
Accepted
time: 1ms
memory: 3912kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
1732
0 1 858069575
1 2 643017934
2 3 540485959
3 4 820000496
4 5 776986350
5 6 604493611
6 7 577636752
7 8 685510561
8 9 865040992
9 10 762236552
10 11 923488407
11 12 636650815
12 13 728034498
13 14 735002870
14 15 619256548
15 16 514085722
16 17 744134689
1...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
1299591209599 630022056918 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok 3 lines

Test #25:

score: 0
Accepted
time: 1ms
memory: 4176kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
2000
0 1 309682260
1 2 582822719
2 3 372695773
3 4 255854267
4 5 992051341
5 6 355887755
6 7 910109803
7 8 568867708
8 9 869299390
9 10 650032264
10 11 371463568
11 12 786674220
12 13 304201693
13 14 855741258
14 15 806288832
15 16 633487600
16 17 633235427
1...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
1239764761863 562451883340 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok 3 lines

Test #26:

score: 0
Accepted
time: 1ms
memory: 3912kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
1801
0 1 1000000000
1 2 1000000000
2 3 1000000000
3 4 1000000000
4 5 1000000000
5 6 1000000000
6 7 1000000000
7 8 1000000000
8 9 1000000000
9 10 1000000000
10 11 1000000000
11 12 1000000000
12 13 1000000000
13 14 1000000000
14 15 1000000000
15 16 1000000000
1...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
1800000000000 900000000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok 3 lines

Test #27:

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

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
171
0 1 766172074
1 2 931210333
2 3 725812205
3 4 639092706
4 5 802029394
5 6 634444904
6 7 666167555
7 8 825997857
8 9 851226871
9 10 843589661
10 11 970684047
11 12 748794185
12 13 791747935
13 14 948683271
14 15 978918318
15 16 829093463
16 17 648684939
17...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
129209451152 62155967967 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok 3 lines

Test #28:

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

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
191
0 1 729078100
1 2 767557971
2 3 180298865
3 4 114953486
4 5 191065394
5 6 940938196
6 7 610880461
7 8 328050996
8 9 183108344
9 10 726774422
10 11 212906788
11 12 321599678
12 13 408399561
13 14 306515309
14 15 992339932
15 16 500835110
16 17 744715358
17...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
91692922954 37294969453 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 3 lines

Test #29:

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

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
200
0 1 1000000000
1 2 1000000000
2 3 1000000000
3 4 1000000000
4 5 1000000000
5 6 1000000000
6 7 1000000000
7 8 1000000000
8 9 1000000000
9 10 1000000000
10 11 1000000000
11 12 1000000000
12 13 1000000000
13 14 1000000000
14 15 1000000000
15 16 1000000000
16...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
199000000000 99000000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok 3 lines

Test #30:

score: 0
Accepted
time: 12ms
memory: 6100kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
59921
0 1 5
1 2 8
2 3 6
3 4 5
4 5 6
5 6 7
6 7 10
7 8 6
8 9 6
9 10 7
10 11 8
11 12 8
12 13 8
13 14 10
14 15 8
15 16 9
16 17 10
17 18 9
18 19 10
19 20 9
20 21 5
21 22 7
22 23 9
23 24 10
24 25 7
25 26 6
26 27 5
27 28 9
28 29 8
29 30 10
30 31 9
31 32 8
32 33 5
33...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
448845 215903 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 3 lines

Test #31:

score: 0
Accepted
time: 16ms
memory: 7912kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
100000
0 1 6
1 2 5
2 3 5
3 4 6
4 5 8
5 6 1
6 7 8
7 8 1
8 9 10
9 10 6
10 11 4
11 12 2
12 13 3
13 14 8
14 15 3
15 16 7
16 17 3
17 18 7
18 19 3
19 20 1
20 21 7
21 22 8
22 23 7
23 24 1
24 25 5
25 26 8
26 27 5
27 28 3
28 29 3
29 30 5
30 31 8
31 32 9
32 33 4
33 34 ...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
551723 235653 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 3 lines

Test #32:

score: 0
Accepted
time: 18ms
memory: 7384kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
90075
0 1 1
1 2 1
2 3 1
3 4 1
4 5 1
5 6 1
6 7 1
7 8 1
8 9 1
9 10 1
10 11 1
11 12 1
12 13 1
13 14 1
14 15 1
15 16 1
16 17 1
17 18 1
18 19 1
19 20 1
20 21 1
21 22 1
22 23 1
23 24 1
24 25 1
25 26 1
26 27 1
27 28 1
28 29 1
29 30 1
30 31 1
31 32 1
32 33 1
33 34 1
...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
90074 45037 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 3 lines

Test #33:

score: 0
Accepted
time: 17ms
memory: 8028kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
100000
0 1 1
1 2 1
2 3 1
3 4 1
4 5 1
5 6 1
6 7 1
7 8 1
8 9 1
9 10 1
10 11 1
11 12 1
12 13 1
13 14 1
14 15 1
15 16 1
16 17 1
17 18 1
18 19 1
19 20 1
20 21 1
21 22 1
22 23 1
23 24 1
24 25 1
25 26 1
26 27 1
27 28 1
28 29 1
29 30 1
30 31 1
31 32 1
32 33 1
33 34 1...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
99999 49999 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok 3 lines

Subtask #3:

score: 0
Wrong Answer

Test #34:

score: 14
Accepted
time: 0ms
memory: 3820kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
2
0 1 4

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
4 0

result:

ok 3 lines

Test #35:

score: -14
Wrong Answer
time: 0ms
memory: 3768kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
5
0 1 1
0 2 4
0 3 3
2 4 2

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
0 0 0 0 0

result:

wrong answer 3rd lines differ - expected: '10 5 1 0 0', found: '0 0 0 0 0'

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Wrong Answer

Test #79:

score: 0
Wrong Answer
time: 18ms
memory: 6484kb

input:

c10234cabdfd6eae47773fb6f163e0350fc797e1
96680
81008 32770 1
53103 75975 1
38090 49649 1
35805 25778 1
50058 68261 1
52213 58881 1
52672 34310 1
1080 42408 1
32306 82599 1
73623 7340 1
87691 42161 1
78365 96557 1
78654 88488 1
5875 25925 1
23217 85743 1
18698 42579 1
90401 84720 1
45973 91271 1
5282...

output:

064bde9ff69ddc34b3b45c2d26d58873d85290d3
OK
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

wrong answer 3rd lines differ - expected: '96679 54857 24550 8415 2125 38...0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0', found: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'

Subtask #6:

score: 0
Skipped

Dependency #5:

0%

Subtask #7:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%