Task: | Evacuation plan |
Sender: | Yytsi |
Submission time: | 2019-02-19 21:54:45 +0200 |
Language: | C++ |
Status: | READY |
Result: | 19 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
#4 | ACCEPTED | 19 |
#5 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.02 s | 3, 5 | details |
#2 | ACCEPTED | 0.03 s | 1, 2, 3, 5 | details |
#3 | WRONG ANSWER | 0.03 s | 1, 2, 5 | details |
#4 | WRONG ANSWER | 0.02 s | 1, 2, 5 | details |
#5 | WRONG ANSWER | 0.02 s | 1, 2, 3, 5 | details |
#6 | WRONG ANSWER | 0.02 s | 1, 2, 5 | details |
#7 | WRONG ANSWER | 0.02 s | 1, 2, 5 | details |
#8 | ACCEPTED | 0.02 s | 1, 2, 5 | details |
#9 | ACCEPTED | 0.02 s | 1, 2, 5 | details |
#10 | WRONG ANSWER | 0.03 s | 1, 2, 5 | details |
#11 | WRONG ANSWER | 0.02 s | 1, 2, 5 | details |
#12 | WRONG ANSWER | 0.02 s | 1, 2, 5 | details |
#13 | WRONG ANSWER | 0.03 s | 1, 2, 5 | details |
#14 | WRONG ANSWER | 0.02 s | 1, 2, 5 | details |
#15 | WRONG ANSWER | 0.03 s | 1, 2, 5 | details |
#16 | WRONG ANSWER | 0.03 s | 1, 2, 5 | details |
#17 | WRONG ANSWER | 0.48 s | 2, 5 | details |
#18 | WRONG ANSWER | 1.03 s | 2, 5 | details |
#19 | WRONG ANSWER | 0.10 s | 2, 5 | details |
#20 | WRONG ANSWER | 0.25 s | 2, 5 | details |
#21 | WRONG ANSWER | 1.03 s | 2, 5 | details |
#22 | WRONG ANSWER | 0.65 s | 2, 5 | details |
#23 | WRONG ANSWER | 0.39 s | 2, 5 | details |
#24 | WRONG ANSWER | 1.04 s | 2, 5 | details |
#25 | WRONG ANSWER | 1.02 s | 2, 5 | details |
#26 | WRONG ANSWER | 1.03 s | 2, 5 | details |
#27 | WRONG ANSWER | 0.28 s | 2, 5 | details |
#28 | WRONG ANSWER | 0.24 s | 2, 5 | details |
#29 | WRONG ANSWER | 0.26 s | 2, 5 | details |
#30 | WRONG ANSWER | 0.24 s | 2, 5 | details |
#31 | WRONG ANSWER | 0.23 s | 2, 5 | details |
#32 | WRONG ANSWER | 0.02 s | 3, 5 | details |
#33 | WRONG ANSWER | 0.01 s | 3, 5 | details |
#34 | WRONG ANSWER | 0.02 s | 3, 5 | details |
#35 | WRONG ANSWER | 0.02 s | 3, 5 | details |
#36 | WRONG ANSWER | 0.02 s | 3, 5 | details |
#37 | WRONG ANSWER | 0.03 s | 3, 5 | details |
#38 | WRONG ANSWER | 0.02 s | 3, 5 | details |
#39 | WRONG ANSWER | 0.02 s | 3, 5 | details |
#40 | WRONG ANSWER | 0.02 s | 3, 5 | details |
#41 | WRONG ANSWER | 0.02 s | 3, 5 | details |
#42 | ACCEPTED | 0.44 s | 4, 5 | details |
#43 | ACCEPTED | 0.72 s | 4, 5 | details |
#44 | ACCEPTED | 0.72 s | 4, 5 | details |
#45 | ACCEPTED | 0.12 s | 4, 5 | details |
#46 | ACCEPTED | 0.53 s | 4, 5 | details |
#47 | ACCEPTED | 0.61 s | 4, 5 | details |
#48 | ACCEPTED | 0.69 s | 4, 5 | details |
#49 | ACCEPTED | 0.77 s | 4, 5 | details |
#50 | ACCEPTED | 0.68 s | 4, 5 | details |
#51 | ACCEPTED | 0.59 s | 4, 5 | details |
#52 | ACCEPTED | 0.64 s | 4, 5 | details |
#53 | ACCEPTED | 0.73 s | 4, 5 | details |
#54 | ACCEPTED | 0.72 s | 4, 5 | details |
#55 | ACCEPTED | 0.67 s | 4, 5 | details |
#56 | ACCEPTED | 0.67 s | 4, 5 | details |
#57 | ACCEPTED | 0.69 s | 4, 5 | details |
#58 | ACCEPTED | 0.69 s | 4, 5 | details |
#59 | ACCEPTED | 0.67 s | 4, 5 | details |
#60 | ACCEPTED | 0.25 s | 2, 4, 5 | details |
#61 | ACCEPTED | 0.78 s | 4, 5 | details |
#62 | ACCEPTED | 0.62 s | 4, 5 | details |
#63 | ACCEPTED | 0.14 s | 4, 5 | details |
#64 | ACCEPTED | 0.19 s | 4, 5 | details |
#65 | ACCEPTED | 0.14 s | 4, 5 | details |
#66 | ACCEPTED | 0.14 s | 4, 5 | details |
#67 | ACCEPTED | 0.19 s | 4, 5 | details |
#68 | ACCEPTED | 0.12 s | 4, 5 | details |
#69 | ACCEPTED | 0.16 s | 4, 5 | details |
#70 | ACCEPTED | 0.12 s | 4, 5 | details |
#71 | ACCEPTED | 0.14 s | 4, 5 | details |
#72 | ACCEPTED | 0.12 s | 4, 5 | details |
#73 | WRONG ANSWER | 0.73 s | 5 | details |
#74 | WRONG ANSWER | 1.05 s | 5 | details |
#75 | WRONG ANSWER | 1.05 s | 5 | details |
#76 | WRONG ANSWER | 1.07 s | 5 | details |
#77 | WRONG ANSWER | 1.06 s | 5 | details |
#78 | WRONG ANSWER | 1.03 s | 5 | details |
#79 | WRONG ANSWER | 1.02 s | 5 | details |
#80 | WRONG ANSWER | 1.06 s | 5 | details |
#81 | WRONG ANSWER | 1.02 s | 5 | details |
#82 | WRONG ANSWER | 1.07 s | 5 | details |
#83 | WRONG ANSWER | 1.04 s | 5 | details |
#84 | WRONG ANSWER | 1.03 s | 5 | details |
#85 | WRONG ANSWER | 1.03 s | 5 | details |
#86 | WRONG ANSWER | 1.03 s | 5 | details |
#87 | WRONG ANSWER | 1.03 s | 5 | details |
#88 | WRONG ANSWER | 1.04 s | 5 | details |
#89 | WRONG ANSWER | 1.03 s | 5 | details |
#90 | WRONG ANSWER | 0.39 s | 5 | details |
#91 | WRONG ANSWER | 1.04 s | 5 | details |
#92 | WRONG ANSWER | 0.90 s | 5 | details |
#93 | WRONG ANSWER | 0.23 s | 5 | details |
#94 | WRONG ANSWER | 0.39 s | 5 | details |
#95 | WRONG ANSWER | 0.26 s | 5 | details |
#96 | WRONG ANSWER | 0.24 s | 5 | details |
#97 | WRONG ANSWER | 0.42 s | 5 | details |
#98 | WRONG ANSWER | 0.39 s | 5 | details |
#99 | WRONG ANSWER | 0.27 s | 5 | details |
#100 | WRONG ANSWER | 0.35 s | 5 | details |
#101 | WRONG ANSWER | 0.25 s | 5 | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:3:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] #define FOR(i, a, b) for (int i=a; i<(b); i++) ^ input/code.cpp:92:5: note: in expansion of macro 'FOR' FOR(i,0,nodes.size()) { ^~~
Code
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i=a; i<(b); i++) #define IO ios_base::sync_with_stdio(0); cin.tie(0) #define F first #define S second #define pb push_back typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define N 100001 int n, m, q, k; struct Query { int x, y, a, b, q_idx; }; vector<Query> searches[N]; vector<pll> adj[N]; ll d[N], ans[N]; int link[N], size[N]; bool on_graph[N]; int root(int x) { if (link[x] == x) return x; return link[x] = root(link[x]); } void unite(int a, int b) { a = root(a); b = root(b); if (a == b) return; if (size[a] < size[b]) swap(a, b); link[b] = a; size[a] += size[b]; } int same(int a, int b) { return root(a) == root(b); } int main() { IO; cin>>n>>m; FOR(i,1,m+1) { int a,b; ll w; cin>>a>>b>>w; adj[a].pb({b,w}); adj[b].pb({a,w}); } priority_queue<pll> pq; cin>>k; FOR(i,1,n+1) d[i] = 2e9; FOR(i,1,k+1) { int x; cin>>x; d[x] = 0; pq.push({0, x}); } while (!pq.empty()) { pll cur = pq.top(); pq.pop(); if (-cur.F != d[cur.S]) continue; for (pll u : adj[cur.S]) { if (u.S + d[cur.S] < d[u.F]) { d[u.F] = d[cur.S] + u.S; pq.push({-d[u.F], u.F}); } } } cin>>q; FOR(i,1,q+1) { int a,b; cin>>a>>b; searches[(1 + n) / 2].pb({ .x = 1, .y = n, .a = a, .b = b, .q_idx = i }); if (i == 12) { cout<<a<<" "<<b<<"\n"; cout<<d[a]<<" "<<d[b]<<"\n"; } } vector<pll> nodes; FOR(i,1,n+1) nodes.pb({d[i], i}); sort(nodes.begin(), nodes.end()); reverse(nodes.begin(), nodes.end()); for (;;) { bool done = true; FOR(i,1,n+1) link[i] = i, size[i] = 1, on_graph[i] = false; FOR(i,0,nodes.size()) { int p = i+1; int node = nodes[i].S; on_graph[node] = true; for (pll sb : adj[node]) { int u = sb.F; if (on_graph[u]) unite(node, u); } while (searches[p].size()) { done = false; Query now = searches[p].back(); searches[p].pop_back(); if (same(now.a, now.b)) now.y = p; else now.x = p+1; if (now.x == now.y) ans[now.q_idx] = nodes[now.x-1].F; else searches[(now.x + now.y) / 2].pb(now); } } if (done) break; } FOR(i,1,q+1) cout<<ans[i]<<"\n"; }
Test details
Test 1
Group: 3, 5
Verdict: ACCEPTED
input |
---|
9 12
1 9 4 1 2 5 2 3 7 2 4 3 ... |
correct output |
---|
5
5 0 7 8 |
user output |
---|
5 5 0 7 8 |
Test 2
Group: 1, 2, 3, 5
Verdict: ACCEPTED
input |
---|
10 20
1 2 657 1 3 522 1 4 448 3 5 855 ... |
correct output |
---|
0
408 541 541 432 ... |
user output |
---|
0 408 541 541 432 ... |
Test 3
Group: 1, 2, 5
Verdict: WRONG ANSWER
input |
---|
1000 999
588 473 61 588 91 30 588 75 125 588 980 551 ... |
correct output |
---|
552
552 552 552 552 ... |
user output |
---|
352 588 1156 552 552 552 552 ... Truncated |
Test 4
Group: 1, 2, 5
Verdict: WRONG ANSWER
input |
---|
1000 999
975 859 302 975 422 394 975 634 444 975 439 384 ... |
correct output |
---|
37
37 37 37 37 ... |
user output |
---|
54 975 445 37 37 37 37 ... Truncated |
Test 5
Group: 1, 2, 3, 5
Verdict: WRONG ANSWER
input |
---|
10 9
7 3 759 7 2 864 7 5 89 7 10 855 ... |
correct output |
---|
491
491 491 0 491 ... |
user output |
---|
9 7 1181 491 491 491 491 ... |
Test 6
Group: 1, 2, 5
Verdict: WRONG ANSWER
input |
---|
1000 999
585 395 355 585 651 77 585 728 215 585 392 955 ... |
correct output |
---|
6
6 6 6 6 ... |
user output |
---|
578 585 515 6 6 6 6 ... Truncated |
Test 7
Group: 1, 2, 5
Verdict: WRONG ANSWER
input |
---|
1000 999
986 358 7 986 142 732 986 586 346 986 193 901 ... |
correct output |
---|
0
0 0 0 0 ... |
user output |
---|
986 558 0 661 0 0 0 ... Truncated |
Test 8
Group: 1, 2, 5
Verdict: ACCEPTED
input |
---|
100 200
1 2 828 1 3 496 1 4 331 2 5 347 ... |
correct output |
---|
0
0 0 0 0 ... |
user output |
---|
0 0 0 0 0 ... |
Test 9
Group: 1, 2, 5
Verdict: ACCEPTED
input |
---|
100 200
1 2 333 2 3 309 3 4 901 1 5 429 ... |
correct output |
---|
0
0 0 0 0 ... |
user output |
---|
0 0 0 0 0 ... |
Test 10
Group: 1, 2, 5
Verdict: WRONG ANSWER
input |
---|
1000 1000
1 2 980 2 3 726 3 4 888 4 5 810 ... |
correct output |
---|
2768
3408 4109 5400 2412 ... |
user output |
---|
631 533 5912 5433 2768 3408 4109 ... Truncated |
Test 11
Group: 1, 2, 5
Verdict: WRONG ANSWER
input |
---|
1000 1000
1 2 353 1 3 672 3 4 861 4 5 517 ... |
correct output |
---|
0
0 0 0 0 ... |
user output |
---|
32 29 0 102 0 0 0 ... Truncated |
Test 12
Group: 1, 2, 5
Verdict: WRONG ANSWER
input |
---|
1000 1000
1 2 127 2 3 854 1 4 813 4 5 8 ... |
correct output |
---|
3925
2711 2047 2304 1751 ... |
user output |
---|
155 67 3378 3059 3925 2711 2047 ... Truncated |
Test 13
Group: 1, 2, 5
Verdict: WRONG ANSWER
input |
---|
1000 999
340 299 654 340 911 553 340 232 256 340 761 558 ... |
correct output |
---|
226
226 226 226 226 ... |
user output |
---|
670 340 518 226 226 226 226 ... Truncated |
Test 14
Group: 1, 2, 5
Verdict: WRONG ANSWER
input |
---|
1000 1000
1 2 188 2 3 247 3 4 641 2 5 473 ... |
correct output |
---|
638
863 441 0 976 ... |
user output |
---|
15 147 460 976 638 863 441 ... Truncated |
Test 15
Group: 1, 2, 5
Verdict: WRONG ANSWER
input |
---|
1000 1000
1 2 393 2 3 682 2 4 841 1 5 84 ... |
correct output |
---|
5609
6225 5028 3588 4348 ... |
user output |
---|
941 892 5479 5374 5609 6225 5028 ... Truncated |
Test 16
Group: 1, 2, 5
Verdict: WRONG ANSWER
input |
---|
1000 1000
1 2 569 1 3 813 2 4 461 4 5 493 ... |
correct output |
---|
5350
2221 1313 3010 3983 ... |
user output |
---|
936 363 2784 2007 5350 2221 1313 ... Truncated |
Test 17
Group: 2, 5
Verdict: WRONG ANSWER
input |
---|
77777 99999
1 2 891 2 3 879 3 4 604 4 5 254 ... |
correct output |
---|
4493
3124 3584 4203 3352 ... |
user output |
---|
64892 26420 4829 4331 4493 3124 3584 ... Truncated |
Test 18
Group: 2, 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 13 1 3 882 3 4 392 2 5 498 ... |
correct output |
---|
852
901 1120 1165 1239 ... |
user output |
---|
85308 95853 1068 1256 852 901 1120 ... Truncated |
Test 19
Group: 2, 5
Verdict: WRONG ANSWER
input |
---|
12321 41332
1 2 81 2 3 165 3 4 941 2 5 167 ... |
correct output |
---|
1270
1486 1185 1113 1222 ... |
user output |
---|
2398 5528 1453 1472 1270 1486 1185 ... Truncated |
Test 20
Group: 2, 5
Verdict: WRONG ANSWER
input |
---|
100000 99999
38940 18613 406 38940 77994 688 38940 1918 847 38940 33444 215 ... |
correct output |
---|
104
104 104 104 104 ... |
user output |
---|
38940 28512 104 599 104 104 104 ... Truncated |
Test 21
Group: 2, 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 461 2 3 439 2 4 578 3 5 317 ... |
correct output |
---|
1097
717 1251 955 1045 ... |
user output |
---|
82673 98285 1128 1243 1097 717 1251 ... Truncated |
Test 22
Group: 2, 5
Verdict: WRONG ANSWER
input |
---|
100000 200000
1 2 984 1 3 96 1 4 469 3 5 480 ... |
correct output |
---|
323
0 156 79 0 ... |
user output |
---|
97782 21340 284 142 323 0 156 ... Truncated |
Test 23
Group: 2, 5
Verdict: WRONG ANSWER
input |
---|
100000 99999
86937 75997 956 75997 86103 901 86103 13024 918 13024 85212 947 ... |
correct output |
---|
29396767
21591510 55276964 33539480 72080903 ... |
user output |
---|
99632 62352 72465798 72464836 29396767 21591510 55276964 ... Truncated |
Test 24
Group: 2, 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 761 1 3 820 3 4 219 4 5 989 ... |
correct output |
---|
970
711 780 699 716 ... |
user output |
---|
79389 21190 1206 1023 970 711 780 ... Truncated |
Test 25
Group: 2, 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 697 2 3 846 1 4 365 4 5 576 ... |
correct output |
---|
355
625 766 605 583 ... |
user output |
---|
82788 47056 611 659 355 625 766 ... Truncated |
Test 26
Group: 2, 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 295 2 3 254 2 4 820 1 5 418 ... |
correct output |
---|
55
371 0 341 0 ... |
user output |
---|
84324 7747 124 219 55 371 0 ... Truncated |
Test 27
Group: 2, 5
Verdict: WRONG ANSWER
input |
---|
100000 99999
60099 24766 247 60099 62884 191 60099 59379 971 60099 30532 420 ... |
correct output |
---|
1
1 1 1 1 ... |
user output |
---|
99536 60099 210 1 1 1 1 ... Truncated |
Test 28
Group: 2, 5
Verdict: WRONG ANSWER
input |
---|
100000 99999
49317 55052 770 49317 54295 838 49317 44228 765 49317 97326 531 ... |
correct output |
---|
35
35 35 35 35 ... |
user output |
---|
10883 49317 172 35 35 35 35 ... Truncated |
Test 29
Group: 2, 5
Verdict: WRONG ANSWER
input |
---|
100000 99999
12914 47476 547 12914 96120 727 12914 44181 338 12914 36309 794 ... |
correct output |
---|
6
6 6 6 6 ... |
user output |
---|
12914 65497 6 391 6 6 6 ... Truncated |
Test 30
Group: 2, 5
Verdict: WRONG ANSWER
input |
---|
100000 99999
49333 95815 271 49333 26107 718 49333 43319 270 49333 41236 458 ... |
correct output |
---|
62
62 62 62 62 ... |
user output |
---|
49333 31781 62 641 62 62 62 ... Truncated |
Test 31
Group: 2, 5
Verdict: WRONG ANSWER
input |
---|
100000 99999
35081 4986 303 35081 4729 336 35081 7666 670 35081 28578 508 ... |
correct output |
---|
257
257 257 257 257 ... |
user output |
---|
53115 35081 394 257 257 257 257 ... Truncated |
Test 32
Group: 3, 5
Verdict: WRONG ANSWER
input |
---|
15 20
1 2 429 2 3 101 3 4 174 4 5 733 ... |
correct output |
---|
226
416 325 325 416 ... |
user output |
---|
15 4 325 584 226 416 325 ... Truncated |
Test 33
Group: 3, 5
Verdict: WRONG ANSWER
input |
---|
15 25
1 2 906 2 3 853 1 4 546 3 5 623 ... |
correct output |
---|
295
295 0 0 794 ... |
user output |
---|
13 4 171 546 295 295 0 ... Truncated |
Test 34
Group: 3, 5
Verdict: WRONG ANSWER
input |
---|
15 40
1 2 406 2 3 911 1 4 725 2 5 482 ... |
correct output |
---|
190
406 0 0 190 ... |
user output |
---|
10 11 0 320 190 406 0 ... Truncated |
Test 35
Group: 3, 5
Verdict: WRONG ANSWER
input |
---|
15 70
1 2 732 2 3 729 3 4 174 1 5 417 ... |
correct output |
---|
61
108 149 61 0 ... |
user output |
---|
12 14 412 144 61 108 149 ... Truncated |
Test 36
Group: 3, 5
Verdict: WRONG ANSWER
input |
---|
15 100
1 2 186 1 3 309 3 4 38 3 5 229 ... |
correct output |
---|
38
49 0 0 0 ... |
user output |
---|
2 3 235 0 38 49 0 ... Truncated |
Test 37
Group: 3, 5
Verdict: WRONG ANSWER
input |
---|
15 100
1 2 46 1 3 998 1 4 524 1 5 42 ... |
correct output |
---|
0
0 66 68 78 ... |
user output |
---|
12 7 61 379 0 0 66 ... Truncated |
Test 38
Group: 3, 5
Verdict: WRONG ANSWER
input |
---|
15 89
1 2 590 1 3 542 2 4 430 3 5 13 ... |
correct output |
---|
0
0 0 0 0 ... |
user output |
---|
14 9 0 86 0 0 0 ... Truncated |
Test 39
Group: 3, 5
Verdict: WRONG ANSWER
input |
---|
15 14
1 2 738 1 3 739 3 4 465 1 5 134 ... |
correct output |
---|
0
0 0 0 0 ... |
user output |
---|
7 15 0 697 0 0 0 ... Truncated |
Test 40
Group: 3, 5
Verdict: WRONG ANSWER
input |
---|
15 14
15 8 438 15 11 672 15 12 20 15 7 752 ... |
correct output |
---|
0
0 0 0 0 ... |
user output |
---|
7 13 752 113 0 0 0 ... Truncated |
Test 41
Group: 3, 5
Verdict: WRONG ANSWER
input |
---|
15 100
1 2 451 1 3 701 1 4 637 1 5 547 ... |
correct output |
---|
164
158 0 152 117 ... |
user output |
---|
2 4 158 205 164 158 0 ... Truncated |
Test 42
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 200000
1 2 931 2 3 916 1 4 342 2 5 18 ... |
correct output |
---|
2782 |
user output |
---|
2782 |
Test 43
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 500000
1 2 485 1 3 567 2 4 479 1 5 166 ... |
correct output |
---|
1480 |
user output |
---|
1480 |
Test 44
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 500000
1 2 129 2 3 866 1 4 165 1 5 254 ... |
correct output |
---|
1084 |
user output |
---|
1084 |
Test 45
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 99999
55393 66829 903 66829 72184 985 72184 47162 950 47162 22279 989 ... |
correct output |
---|
0 |
user output |
---|
0 |
Test 46
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 500000
1 2 783 2 3 877 2 4 834 1 5 734 ... |
correct output |
---|
557 |
user output |
---|
557 |
Test 47
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 500000
1 2 817 1 3 411 1 4 947 2 5 943 ... |
correct output |
---|
794 |
user output |
---|
794 |
Test 48
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 500000
1 2 212 1 3 723 1 4 614 4 5 819 ... |
correct output |
---|
712 |
user output |
---|
712 |
Test 49
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 500000
1 2 203 2 3 684 2 4 766 3 5 287 ... |
correct output |
---|
879 |
user output |
---|
879 |
Test 50
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 500000
1 2 879 2 3 322 3 4 851 3 5 348 ... |
correct output |
---|
950 |
user output |
---|
950 |
Test 51
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 500000
1 2 36 1 3 883 2 4 519 3 5 579 ... |
correct output |
---|
837 |
user output |
---|
837 |
Test 52
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 500000
1 2 1000 1 3 207 1 4 668 4 5 272 ... |
correct output |
---|
499 |
user output |
---|
499 |
Test 53
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 500000
1 2 991 1 3 104 1 4 717 4 5 165 ... |
correct output |
---|
447 |
user output |
---|
447 |
Test 54
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 500000
1 2 803 1 3 429 3 4 634 4 5 99 ... |
correct output |
---|
315 |
user output |
---|
315 |
Test 55
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 500000
1 2 33 1 3 661 1 4 630 3 5 685 ... |
correct output |
---|
350 |
user output |
---|
350 |
Test 56
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 500000
1 2 636 2 3 716 1 4 58 2 5 337 ... |
correct output |
---|
50 |
user output |
---|
50 |
Test 57
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 500000
1 2 294 2 3 768 1 4 524 1 5 307 ... |
correct output |
---|
366 |
user output |
---|
366 |
Test 58
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 500000
1 2 87 1 3 998 3 4 888 4 5 103 ... |
correct output |
---|
759 |
user output |
---|
759 |
Test 59
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 500000
1 2 176 2 3 314 3 4 513 2 5 686 ... |
correct output |
---|
1222 |
user output |
---|
1222 |
Test 60
Group: 2, 4, 5
Verdict: ACCEPTED
input |
---|
100000 99999
62990 65315 931 65315 3455 970 3455 98310 995 98310 23065 952 ... |
correct output |
---|
95052504 |
user output |
---|
95052504 |
Test 61
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 500000
1 2 585 2 3 805 3 4 581 1 5 572 ... |
correct output |
---|
800 |
user output |
---|
800 |
Test 62
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 500000
1 2 150 1 3 624 3 4 361 1 5 742 ... |
correct output |
---|
0 |
user output |
---|
0 |
Test 63
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 99999
42321 26741 992 42321 69329 304 42321 5758 819 42321 29266 648 ... |
correct output |
---|
111 |
user output |
---|
111 |
Test 64
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 100000
51519 55325 253 55325 18282 583 18282 90551 470 90551 91972 266 ... |
correct output |
---|
1057897 |
user output |
---|
1057897 |
Test 65
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 99999
54801 39194 733 54801 39401 162 54801 65113 479 54801 61590 30 ... |
correct output |
---|
3 |
user output |
---|
3 |
Test 66
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 99999
15780 41412 52 15780 99212 342 15780 8094 961 15780 33547 16 ... |
correct output |
---|
19 |
user output |
---|
19 |
Test 67
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 100000
76627 21712 427 21712 26993 256 26993 80393 100 80393 56194 44 ... |
correct output |
---|
0 |
user output |
---|
0 |
Test 68
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 99999
88549 9364 973 9364 6403 998 6403 29693 969 29693 59321 938 ... |
correct output |
---|
0 |
user output |
---|
0 |
Test 69
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 99999
60084 18317 681 60084 77472 797 60084 93299 190 60084 76120 745 ... |
correct output |
---|
1 |
user output |
---|
1 |
Test 70
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 99999
67813 44109 993 44109 32579 980 32579 83236 911 83236 58703 958 ... |
correct output |
---|
0 |
user output |
---|
0 |
Test 71
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 99999
99416 74269 87 99416 87958 424 99416 43397 39 99416 62377 783 ... |
correct output |
---|
1 |
user output |
---|
1 |
Test 72
Group: 4, 5
Verdict: ACCEPTED
input |
---|
100000 99999
80340 75986 985 75986 12073 987 12073 14775 998 14775 51604 912 ... |
correct output |
---|
0 |
user output |
---|
0 |
Test 73
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 200000
1 2 641 2 3 327 2 4 612 3 5 929 ... |
correct output |
---|
2789
2693 2317 2490 2585 ... |
user output |
---|
60015 48708 2502 3137 2789 2693 2317 ... Truncated |
Test 74
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 423 1 3 258 3 4 573 2 5 503 ... |
correct output |
---|
943
879 757 840 810 ... |
user output |
---|
33240 52912 585 1002 943 879 757 ... Truncated |
Test 75
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 696 2 3 91 1 4 594 1 5 389 ... |
correct output |
---|
928
915 909 978 302 ... |
user output |
---|
21794 82962 1075 968 928 915 909 ... Truncated |
Test 76
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 839 1 3 344 1 4 742 3 5 969 ... |
correct output |
---|
741
1036 993 553 1057 ... |
user output |
---|
21810 91675 1036 1041 741 1036 993 ... Truncated |
Test 77
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 451 1 3 46 3 4 291 4 5 937 ... |
correct output |
---|
876
692 608 407 459 ... |
user output |
---|
74704 81310 733 852 876 692 608 ... Truncated |
Test 78
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 750 1 3 891 2 4 533 1 5 421 ... |
correct output |
---|
662
632 594 622 601 ... |
user output |
---|
34977 38746 556 530 662 632 594 ... Truncated |
Test 79
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 300 2 3 460 3 4 834 3 5 381 ... |
correct output |
---|
594
954 739 873 953 ... |
user output |
---|
69728 58295 925 771 594 954 739 ... Truncated |
Test 80
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 311 1 3 228 2 4 42 3 5 981 ... |
correct output |
---|
596
977 754 830 731 ... |
user output |
---|
20813 51587 1297 768 596 977 754 ... Truncated |
Test 81
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 655 1 3 626 1 4 92 1 5 719 ... |
correct output |
---|
588
957 831 766 558 ... |
user output |
---|
6306 52950 883 892 588 957 831 ... Truncated |
Test 82
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 241 2 3 717 2 4 756 4 5 555 ... |
correct output |
---|
1077
655 838 981 1077 ... |
user output |
---|
37518 38753 1143 1167 1077 655 838 ... Truncated |
Test 83
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 22 2 3 950 2 4 300 2 5 192 ... |
correct output |
---|
457
426 389 460 518 ... |
user output |
---|
18011 77568 1203 713 457 426 389 ... Truncated |
Test 84
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 235 1 3 508 3 4 611 1 5 468 ... |
correct output |
---|
215
458 591 147 495 ... |
user output |
---|
732 85641 303 356 215 458 591 ... Truncated |
Test 85
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 203 1 3 412 3 4 390 2 5 433 ... |
correct output |
---|
215
314 284 413 301 ... |
user output |
---|
91909 63776 505 506 215 314 284 ... Truncated |
Test 86
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 427 2 3 613 1 4 102 1 5 320 ... |
correct output |
---|
171
16 110 184 63 ... |
user output |
---|
7397 40631 77 70 171 16 110 ... Truncated |
Test 87
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 738 2 3 891 3 4 468 4 5 717 ... |
correct output |
---|
505
51 370 297 108 ... |
user output |
---|
52538 93932 490 375 505 51 370 ... Truncated |
Test 88
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 552 2 3 990 1 4 264 3 5 715 ... |
correct output |
---|
589
751 640 868 540 ... |
user output |
---|
90861 31479 744 602 589 751 640 ... Truncated |
Test 89
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 928 2 3 476 3 4 531 4 5 166 ... |
correct output |
---|
1015
996 1150 995 1045 ... |
user output |
---|
25751 57175 947 739 1015 996 1150 ... Truncated |
Test 90
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 99999
92489 77658 971 77658 44038 908 44038 16706 947 16706 86719 936 ... |
correct output |
---|
95057187
21105802 9382625 33465301 45188238 ... |
user output |
---|
96623 72129 368406 53404993 95057187 21105802 9382625 ... Truncated |
Test 91
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 499 2 3 548 1 4 153 3 5 7 ... |
correct output |
---|
978
983 634 768 627 ... |
user output |
---|
43443 29021 1195 717 978 983 634 ... Truncated |
Test 92
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 500000
1 2 663 1 3 944 1 4 67 1 5 976 ... |
correct output |
---|
0
0 0 0 0 ... |
user output |
---|
91870 53656 98 10 0 0 0 ... Truncated |
Test 93
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 99999
12420 1528 466 12420 42872 479 12420 8461 723 12420 75677 717 ... |
correct output |
---|
55
55 55 55 55 ... |
user output |
---|
54702 97284 106 766 55 55 55 ... Truncated |
Test 94
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 100000
55076 46178 852 46178 35188 936 35188 36448 616 36448 20101 711 ... |
correct output |
---|
405459
1058750 3569995 3807 2822955 ... |
user output |
---|
3090 84174 1250939 2905445 405459 1058750 3569995 ... Truncated |
Test 95
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 99999
86054 48657 652 86054 68231 412 86054 29096 379 86054 59437 691 ... |
correct output |
---|
1
1 1 1 1 ... |
user output |
---|
76507 89037 360 719 1 1 1 ... Truncated |
Test 96
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 99999
39950 45152 493 39950 48400 664 39950 31284 726 39950 86952 141 ... |
correct output |
---|
14
14 14 14 14 ... |
user output |
---|
31206 52372 663 196 14 14 14 ... Truncated |
Test 97
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 100000
12935 19528 317 19528 89291 248 89291 70689 378 70689 6165 906 ... |
correct output |
---|
1087
0 0 0 159917 ... |
user output |
---|
65749 21805 5929 7171 1087 0 0 ... Truncated |
Test 98
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 99999
40231 61273 959 61273 21887 924 21887 63910 986 63910 64968 933 ... |
correct output |
---|
0
6434711 9195470 0 0 ... |
user output |
---|
10709 65902 35730407 44086735 0 6434711 9195470 ... Truncated |
Test 99
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 99999
74744 3772 134 74744 37184 823 74744 15444 783 74744 96445 78 ... |
correct output |
---|
2
2 2 2 2 ... |
user output |
---|
47548 94478 21 552 2 2 2 ... Truncated |
Test 100
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 99999
50234 26601 934 26601 98648 926 98648 57972 967 57972 43476 947 ... |
correct output |
---|
0
0 0 0 0 ... |
user output |
---|
97294 76291 30368224 13379819 0 0 0 ... Truncated |
Test 101
Group: 5
Verdict: WRONG ANSWER
input |
---|
100000 99999
56054 80449 561 56054 9214 259 56054 62006 238 56054 80043 946 ... |
correct output |
---|
23
23 23 23 23 ... |
user output |
---|
11946 47084 861 838 23 23 23 ... Truncated |