CSES - IZhO 2018, day 1 - Results
Submission details
Task:Evacuation plan
Sender:ollpu
Submission time:2019-02-17 19:28:30 +0200
Language:C++
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED10
#2ACCEPTED13
#3ACCEPTED12
#4ACCEPTED19
#5ACCEPTED46
Test results
testverdicttimegroup
#1ACCEPTED0.03 s3, 5details
#2ACCEPTED0.05 s1, 2, 3, 5details
#3ACCEPTED0.04 s1, 2, 5details
#4ACCEPTED0.05 s1, 2, 5details
#5ACCEPTED0.04 s1, 2, 3, 5details
#6ACCEPTED0.03 s1, 2, 5details
#7ACCEPTED0.03 s1, 2, 5details
#8ACCEPTED0.03 s1, 2, 5details
#9ACCEPTED0.03 s1, 2, 5details
#10ACCEPTED0.03 s1, 2, 5details
#11ACCEPTED0.04 s1, 2, 5details
#12ACCEPTED0.04 s1, 2, 5details
#13ACCEPTED0.03 s1, 2, 5details
#14ACCEPTED0.02 s1, 2, 5details
#15ACCEPTED0.03 s1, 2, 5details
#16ACCEPTED0.04 s1, 2, 5details
#17ACCEPTED0.49 s2, 5details
#18ACCEPTED1.05 s2, 5details
#19ACCEPTED0.10 s2, 5details
#20ACCEPTED0.28 s2, 5details
#21ACCEPTED1.04 s2, 5details
#22ACCEPTED0.64 s2, 5details
#23ACCEPTED0.40 s2, 5details
#24ACCEPTED1.04 s2, 5details
#25ACCEPTED1.04 s2, 5details
#26ACCEPTED1.07 s2, 5details
#27ACCEPTED0.27 s2, 5details
#28ACCEPTED0.27 s2, 5details
#29ACCEPTED0.28 s2, 5details
#30ACCEPTED0.27 s2, 5details
#31ACCEPTED0.26 s2, 5details
#32ACCEPTED0.04 s3, 5details
#33ACCEPTED0.03 s3, 5details
#34ACCEPTED0.03 s3, 5details
#35ACCEPTED0.03 s3, 5details
#36ACCEPTED0.03 s3, 5details
#37ACCEPTED0.03 s3, 5details
#38ACCEPTED0.04 s3, 5details
#39ACCEPTED0.03 s3, 5details
#40ACCEPTED0.04 s3, 5details
#41ACCEPTED0.04 s3, 5details
#42ACCEPTED0.53 s4, 5details
#43ACCEPTED0.89 s4, 5details
#44ACCEPTED0.85 s4, 5details
#45ACCEPTED0.22 s4, 5details
#46ACCEPTED0.85 s4, 5details
#47ACCEPTED0.86 s4, 5details
#48ACCEPTED0.89 s4, 5details
#49ACCEPTED0.91 s4, 5details
#50ACCEPTED0.87 s4, 5details
#51ACCEPTED0.85 s4, 5details
#52ACCEPTED0.88 s4, 5details
#53ACCEPTED0.89 s4, 5details
#54ACCEPTED0.85 s4, 5details
#55ACCEPTED0.89 s4, 5details
#56ACCEPTED0.85 s4, 5details
#57ACCEPTED0.85 s4, 5details
#58ACCEPTED0.86 s4, 5details
#59ACCEPTED0.85 s4, 5details
#60ACCEPTED0.22 s2, 4, 5details
#61ACCEPTED0.89 s4, 5details
#62ACCEPTED0.76 s4, 5details
#63ACCEPTED0.17 s4, 5details
#64ACCEPTED0.24 s4, 5details
#65ACCEPTED0.17 s4, 5details
#66ACCEPTED0.17 s4, 5details
#67ACCEPTED0.29 s4, 5details
#68ACCEPTED0.23 s4, 5details
#69ACCEPTED0.17 s4, 5details
#70ACCEPTED0.23 s4, 5details
#71ACCEPTED0.17 s4, 5details
#72ACCEPTED0.25 s4, 5details
#73ACCEPTED0.72 s5details
#74ACCEPTED1.04 s5details
#75ACCEPTED1.05 s5details
#76ACCEPTED1.08 s5details
#77ACCEPTED1.04 s5details
#78ACCEPTED1.04 s5details
#79ACCEPTED1.04 s5details
#80ACCEPTED1.04 s5details
#81ACCEPTED1.04 s5details
#82ACCEPTED1.04 s5details
#83ACCEPTED1.04 s5details
#84ACCEPTED1.04 s5details
#85ACCEPTED1.07 s5details
#86ACCEPTED1.04 s5details
#87ACCEPTED1.08 s5details
#88ACCEPTED1.04 s5details
#89ACCEPTED1.05 s5details
#90ACCEPTED0.41 s5details
#91ACCEPTED1.05 s5details
#92ACCEPTED0.94 s5details
#93ACCEPTED0.28 s5details
#94ACCEPTED0.42 s5details
#95ACCEPTED0.26 s5details
#96ACCEPTED0.26 s5details
#97ACCEPTED0.43 s5details
#98ACCEPTED0.40 s5details
#99ACCEPTED0.27 s5details
#100ACCEPTED0.40 s5details
#101ACCEPTED0.26 s5details

Code

#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
const int N = 1<<17;
vector<int> G[2*N];
int u_p[N], u_s[N], xz[N];
void u_reset() {
  for (int i = 0; i < N; ++i) u_p[i] = i, u_s[i] = 1, xz[i] = 0;
}
int u_get(int i) {
  if (i == u_p[i]) return i;
  return u_p[i] = u_get(u_p[i]);
}
void u_join(int a, int b) {
  a = u_get(a);
  b = u_get(b);
  if (a == b) return;
  if (u_s[b] > u_s[a]) swap(a, b);
  u_p[b] = a;
  u_s[a] += u_s[b];
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> v[n];
  int d[n];
  for (int i = 0; i < m; ++i) {
    int a, b, w;
    cin >> a >> b >> w;
    a--; b--;
    v[a].push_back({b, w});
    v[b].push_back({a, w});
  }
  for (int i = 0; i < n; ++i) {
    d[i] = 2e9;
  }
  priority_queue<pair<int, int>> qu;
  {
    int k;
    cin >> k;
    for (int i = 0; i < k; ++i) {
      int g;
      cin >> g;
      g--;
      qu.push({0, g});
      d[g] = 0;
    }
  }
  while (!qu.empty()) {
    auto qp = qu.top();
    qu.pop();
    if (-qp.F != d[qp.S]) continue;
    int i = qp.S;
    for (auto p : v[i]) {
      if (d[i]+p.S < d[p.F]) {
        d[p.F] = d[i]+p.S;
        qu.push({-d[p.F], p.F});
      }
    }
  }
  int w[n];
  for (int i = 0; i < n; ++i) w[i] = i;
  sort(w, w+n, [&d](int a, int b) { return d[a] > d[b]; });
  int q;
  cin >> q;
  pair<int, int> qt[q];
  for (int i = 0; i < q; ++i) {
    cin >> qt[i].F >> qt[i].S;
    qt[i].F--; qt[i].S--;
    G[1].push_back(i);
  }
  for (int l = 0; l < 17; ++l) {
    int ws = N>>(l+1);
    int wi = 0, wm = 0;
    u_reset();
    for (int pi = 1<<l; pi < 1<<(l+1); ++pi) {
      wm += ws;
      for (; wi < wm && wi < n; ++wi) {
        int i = w[wi];
        for (auto p : v[i]) {
          if (xz[p.F]) u_join(i, p.F);
        }
        xz[i] = 1;
      }
      for (int qi : G[pi]) {
        G[pi*2 + (u_get(qt[qi].F) != u_get(qt[qi].S))].push_back(qi);
      }
      wm += ws;
    }
  }
  int result[q];
  for (int i = 0; i < n; ++i) {
    for (int j : G[N+i]) {
      result[j] = d[w[i]];
    }
  }
  for (int i = 0; i < q; ++i) {
    cout << result[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: ACCEPTED

input
1000 999
588 473 61
588 91 30
588 75 125
588 980 551
...

correct output
552
552
552
552
552
...

user output
552
552
552
552
552
...
Truncated

Test 4

Group: 1, 2, 5

Verdict: ACCEPTED

input
1000 999
975 859 302
975 422 394
975 634 444
975 439 384
...

correct output
37
37
37
37
37
...

user output
37
37
37
37
37
...
Truncated

Test 5

Group: 1, 2, 3, 5

Verdict: ACCEPTED

input
10 9
7 3 759
7 2 864
7 5 89
7 10 855
...

correct output
491
491
491
0
491
...

user output
491
491
491
0
491
...

Test 6

Group: 1, 2, 5

Verdict: ACCEPTED

input
1000 999
585 395 355
585 651 77
585 728 215
585 392 955
...

correct output
6
6
6
6
6
...

user output
6
6
6
6
6
...
Truncated

Test 7

Group: 1, 2, 5

Verdict: ACCEPTED

input
1000 999
986 358 7
986 142 732
986 586 346
986 193 901
...

correct output
0
0
0
0
0
...

user output
0
0
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: ACCEPTED

input
1000 1000
1 2 980
2 3 726
3 4 888
4 5 810
...

correct output
2768
3408
4109
5400
2412
...

user output
2768
3408
4109
5400
2412
...
Truncated

Test 11

Group: 1, 2, 5

Verdict: ACCEPTED

input
1000 1000
1 2 353
1 3 672
3 4 861
4 5 517
...

correct output
0
0
0
0
0
...

user output
0
0
0
0
0
...
Truncated

Test 12

Group: 1, 2, 5

Verdict: ACCEPTED

input
1000 1000
1 2 127
2 3 854
1 4 813
4 5 8
...

correct output
3925
2711
2047
2304
1751
...

user output
3925
2711
2047
2304
1751
...
Truncated

Test 13

Group: 1, 2, 5

Verdict: ACCEPTED

input
1000 999
340 299 654
340 911 553
340 232 256
340 761 558
...

correct output
226
226
226
226
226
...

user output
226
226
226
226
226
...
Truncated

Test 14

Group: 1, 2, 5

Verdict: ACCEPTED

input
1000 1000
1 2 188
2 3 247
3 4 641
2 5 473
...

correct output
638
863
441
0
976
...

user output
638
863
441
0
976
...
Truncated

Test 15

Group: 1, 2, 5

Verdict: ACCEPTED

input
1000 1000
1 2 393
2 3 682
2 4 841
1 5 84
...

correct output
5609
6225
5028
3588
4348
...

user output
5609
6225
5028
3588
4348
...
Truncated

Test 16

Group: 1, 2, 5

Verdict: ACCEPTED

input
1000 1000
1 2 569
1 3 813
2 4 461
4 5 493
...

correct output
5350
2221
1313
3010
3983
...

user output
5350
2221
1313
3010
3983
...
Truncated

Test 17

Group: 2, 5

Verdict: ACCEPTED

input
77777 99999
1 2 891
2 3 879
3 4 604
4 5 254
...

correct output
4493
3124
3584
4203
3352
...

user output
4493
3124
3584
4203
3352
...
Truncated

Test 18

Group: 2, 5

Verdict: ACCEPTED

input
100000 500000
1 2 13
1 3 882
3 4 392
2 5 498
...

correct output
852
901
1120
1165
1239
...

user output
852
901
1120
1165
1239
...
Truncated

Test 19

Group: 2, 5

Verdict: ACCEPTED

input
12321 41332
1 2 81
2 3 165
3 4 941
2 5 167
...

correct output
1270
1486
1185
1113
1222
...

user output
1270
1486
1185
1113
1222
...
Truncated

Test 20

Group: 2, 5

Verdict: ACCEPTED

input
100000 99999
38940 18613 406
38940 77994 688
38940 1918 847
38940 33444 215
...

correct output
104
104
104
104
104
...

user output
104
104
104
104
104
...
Truncated

Test 21

Group: 2, 5

Verdict: ACCEPTED

input
100000 500000
1 2 461
2 3 439
2 4 578
3 5 317
...

correct output
1097
717
1251
955
1045
...

user output
1097
717
1251
955
1045
...
Truncated

Test 22

Group: 2, 5

Verdict: ACCEPTED

input
100000 200000
1 2 984
1 3 96
1 4 469
3 5 480
...

correct output
323
0
156
79
0
...

user output
323
0
156
79
0
...
Truncated

Test 23

Group: 2, 5

Verdict: ACCEPTED

input
100000 99999
86937 75997 956
75997 86103 901
86103 13024 918
13024 85212 947
...

correct output
29396767
21591510
55276964
33539480
72080903
...

user output
29396767
21591510
55276964
33539480
72080903
...
Truncated

Test 24

Group: 2, 5

Verdict: ACCEPTED

input
100000 500000
1 2 761
1 3 820
3 4 219
4 5 989
...

correct output
970
711
780
699
716
...

user output
970
711
780
699
716
...
Truncated

Test 25

Group: 2, 5

Verdict: ACCEPTED

input
100000 500000
1 2 697
2 3 846
1 4 365
4 5 576
...

correct output
355
625
766
605
583
...

user output
355
625
766
605
583
...
Truncated

Test 26

Group: 2, 5

Verdict: ACCEPTED

input
100000 500000
1 2 295
2 3 254
2 4 820
1 5 418
...

correct output
55
371
0
341
0
...

user output
55
371
0
341
0
...
Truncated

Test 27

Group: 2, 5

Verdict: ACCEPTED

input
100000 99999
60099 24766 247
60099 62884 191
60099 59379 971
60099 30532 420
...

correct output
1
1
1
1
1
...

user output
1
1
1
1
1
...
Truncated

Test 28

Group: 2, 5

Verdict: ACCEPTED

input
100000 99999
49317 55052 770
49317 54295 838
49317 44228 765
49317 97326 531
...

correct output
35
35
35
35
35
...

user output
35
35
35
35
35
...
Truncated

Test 29

Group: 2, 5

Verdict: ACCEPTED

input
100000 99999
12914 47476 547
12914 96120 727
12914 44181 338
12914 36309 794
...

correct output
6
6
6
6
6
...

user output
6
6
6
6
6
...
Truncated

Test 30

Group: 2, 5

Verdict: ACCEPTED

input
100000 99999
49333 95815 271
49333 26107 718
49333 43319 270
49333 41236 458
...

correct output
62
62
62
62
62
...

user output
62
62
62
62
62
...
Truncated

Test 31

Group: 2, 5

Verdict: ACCEPTED

input
100000 99999
35081 4986 303
35081 4729 336
35081 7666 670
35081 28578 508
...

correct output
257
257
257
257
257
...

user output
257
257
257
257
257
...
Truncated

Test 32

Group: 3, 5

Verdict: ACCEPTED

input
15 20
1 2 429
2 3 101
3 4 174
4 5 733
...

correct output
226
416
325
325
416
...

user output
226
416
325
325
416
...
Truncated

Test 33

Group: 3, 5

Verdict: ACCEPTED

input
15 25
1 2 906
2 3 853
1 4 546
3 5 623
...

correct output
295
295
0
0
794
...

user output
295
295
0
0
794
...
Truncated

Test 34

Group: 3, 5

Verdict: ACCEPTED

input
15 40
1 2 406
2 3 911
1 4 725
2 5 482
...

correct output
190
406
0
0
190
...

user output
190
406
0
0
190
...
Truncated

Test 35

Group: 3, 5

Verdict: ACCEPTED

input
15 70
1 2 732
2 3 729
3 4 174
1 5 417
...

correct output
61
108
149
61
0
...

user output
61
108
149
61
0
...
Truncated

Test 36

Group: 3, 5

Verdict: ACCEPTED

input
15 100
1 2 186
1 3 309
3 4 38
3 5 229
...

correct output
38
49
0
0
0
...

user output
38
49
0
0
0
...
Truncated

Test 37

Group: 3, 5

Verdict: ACCEPTED

input
15 100
1 2 46
1 3 998
1 4 524
1 5 42
...

correct output
0
0
66
68
78
...

user output
0
0
66
68
78
...
Truncated

Test 38

Group: 3, 5

Verdict: ACCEPTED

input
15 89
1 2 590
1 3 542
2 4 430
3 5 13
...

correct output
0
0
0
0
0
...

user output
0
0
0
0
0
...
Truncated

Test 39

Group: 3, 5

Verdict: ACCEPTED

input
15 14
1 2 738
1 3 739
3 4 465
1 5 134
...

correct output
0
0
0
0
0
...

user output
0
0
0
0
0
...
Truncated

Test 40

Group: 3, 5

Verdict: ACCEPTED

input
15 14
15 8 438
15 11 672
15 12 20
15 7 752
...

correct output
0
0
0
0
0
...

user output
0
0
0
0
0
...
Truncated

Test 41

Group: 3, 5

Verdict: ACCEPTED

input
15 100
1 2 451
1 3 701
1 4 637
1 5 547
...

correct output
164
158
0
152
117
...

user output
164
158
0
152
117
...
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: ACCEPTED

input
100000 200000
1 2 641
2 3 327
2 4 612
3 5 929
...

correct output
2789
2693
2317
2490
2585
...

user output
2789
2693
2317
2490
2585
...
Truncated

Test 74

Group: 5

Verdict: ACCEPTED

input
100000 500000
1 2 423
1 3 258
3 4 573
2 5 503
...

correct output
943
879
757
840
810
...

user output
943
879
757
840
810
...
Truncated

Test 75

Group: 5

Verdict: ACCEPTED

input
100000 500000
1 2 696
2 3 91
1 4 594
1 5 389
...

correct output
928
915
909
978
302
...

user output
928
915
909
978
302
...
Truncated

Test 76

Group: 5

Verdict: ACCEPTED

input
100000 500000
1 2 839
1 3 344
1 4 742
3 5 969
...

correct output
741
1036
993
553
1057
...

user output
741
1036
993
553
1057
...
Truncated

Test 77

Group: 5

Verdict: ACCEPTED

input
100000 500000
1 2 451
1 3 46
3 4 291
4 5 937
...

correct output
876
692
608
407
459
...

user output
876
692
608
407
459
...
Truncated

Test 78

Group: 5

Verdict: ACCEPTED

input
100000 500000
1 2 750
1 3 891
2 4 533
1 5 421
...

correct output
662
632
594
622
601
...

user output
662
632
594
622
601
...
Truncated

Test 79

Group: 5

Verdict: ACCEPTED

input
100000 500000
1 2 300
2 3 460
3 4 834
3 5 381
...

correct output
594
954
739
873
953
...

user output
594
954
739
873
953
...
Truncated

Test 80

Group: 5

Verdict: ACCEPTED

input
100000 500000
1 2 311
1 3 228
2 4 42
3 5 981
...

correct output
596
977
754
830
731
...

user output
596
977
754
830
731
...
Truncated

Test 81

Group: 5

Verdict: ACCEPTED

input
100000 500000
1 2 655
1 3 626
1 4 92
1 5 719
...

correct output
588
957
831
766
558
...

user output
588
957
831
766
558
...
Truncated

Test 82

Group: 5

Verdict: ACCEPTED

input
100000 500000
1 2 241
2 3 717
2 4 756
4 5 555
...

correct output
1077
655
838
981
1077
...

user output
1077
655
838
981
1077
...
Truncated

Test 83

Group: 5

Verdict: ACCEPTED

input
100000 500000
1 2 22
2 3 950
2 4 300
2 5 192
...

correct output
457
426
389
460
518
...

user output
457
426
389
460
518
...
Truncated

Test 84

Group: 5

Verdict: ACCEPTED

input
100000 500000
1 2 235
1 3 508
3 4 611
1 5 468
...

correct output
215
458
591
147
495
...

user output
215
458
591
147
495
...
Truncated

Test 85

Group: 5

Verdict: ACCEPTED

input
100000 500000
1 2 203
1 3 412
3 4 390
2 5 433
...

correct output
215
314
284
413
301
...

user output
215
314
284
413
301
...
Truncated

Test 86

Group: 5

Verdict: ACCEPTED

input
100000 500000
1 2 427
2 3 613
1 4 102
1 5 320
...

correct output
171
16
110
184
63
...

user output
171
16
110
184
63
...
Truncated

Test 87

Group: 5

Verdict: ACCEPTED

input
100000 500000
1 2 738
2 3 891
3 4 468
4 5 717
...

correct output
505
51
370
297
108
...

user output
505
51
370
297
108
...
Truncated

Test 88

Group: 5

Verdict: ACCEPTED

input
100000 500000
1 2 552
2 3 990
1 4 264
3 5 715
...

correct output
589
751
640
868
540
...

user output
589
751
640
868
540
...
Truncated

Test 89

Group: 5

Verdict: ACCEPTED

input
100000 500000
1 2 928
2 3 476
3 4 531
4 5 166
...

correct output
1015
996
1150
995
1045
...

user output
1015
996
1150
995
1045
...
Truncated

Test 90

Group: 5

Verdict: ACCEPTED

input
100000 99999
92489 77658 971
77658 44038 908
44038 16706 947
16706 86719 936
...

correct output
95057187
21105802
9382625
33465301
45188238
...

user output
95057187
21105802
9382625
33465301
45188238
...
Truncated

Test 91

Group: 5

Verdict: ACCEPTED

input
100000 500000
1 2 499
2 3 548
1 4 153
3 5 7
...

correct output
978
983
634
768
627
...

user output
978
983
634
768
627
...
Truncated

Test 92

Group: 5

Verdict: ACCEPTED

input
100000 500000
1 2 663
1 3 944
1 4 67
1 5 976
...

correct output
0
0
0
0
0
...

user output
0
0
0
0
0
...
Truncated

Test 93

Group: 5

Verdict: ACCEPTED

input
100000 99999
12420 1528 466
12420 42872 479
12420 8461 723
12420 75677 717
...

correct output
55
55
55
55
55
...

user output
55
55
55
55
55
...
Truncated

Test 94

Group: 5

Verdict: ACCEPTED

input
100000 100000
55076 46178 852
46178 35188 936
35188 36448 616
36448 20101 711
...

correct output
405459
1058750
3569995
3807
2822955
...

user output
405459
1058750
3569995
3807
2822955
...
Truncated

Test 95

Group: 5

Verdict: ACCEPTED

input
100000 99999
86054 48657 652
86054 68231 412
86054 29096 379
86054 59437 691
...

correct output
1
1
1
1
1
...

user output
1
1
1
1
1
...
Truncated

Test 96

Group: 5

Verdict: ACCEPTED

input
100000 99999
39950 45152 493
39950 48400 664
39950 31284 726
39950 86952 141
...

correct output
14
14
14
14
14
...

user output
14
14
14
14
14
...
Truncated

Test 97

Group: 5

Verdict: ACCEPTED

input
100000 100000
12935 19528 317
19528 89291 248
89291 70689 378
70689 6165 906
...

correct output
1087
0
0
0
159917
...

user output
1087
0
0
0
159917
...
Truncated

Test 98

Group: 5

Verdict: ACCEPTED

input
100000 99999
40231 61273 959
61273 21887 924
21887 63910 986
63910 64968 933
...

correct output
0
6434711
9195470
0
0
...

user output
0
6434711
9195470
0
0
...
Truncated

Test 99

Group: 5

Verdict: ACCEPTED

input
100000 99999
74744 3772 134
74744 37184 823
74744 15444 783
74744 96445 78
...

correct output
2
2
2
2
2
...

user output
2
2
2
2
2
...
Truncated

Test 100

Group: 5

Verdict: ACCEPTED

input
100000 99999
50234 26601 934
26601 98648 926
98648 57972 967
57972 43476 947
...

correct output
0
0
0
0
0
...

user output
0
0
0
0
0
...
Truncated

Test 101

Group: 5

Verdict: ACCEPTED

input
100000 99999
56054 80449 561
56054 9214 259
56054 62006 238
56054 80043 946
...

correct output
23
23
23
23
23
...

user output
23
23
23
23
23
...
Truncated