CSES - IZhO 2018, day 1 - Results
Submission details
Task:Evacuation plan
Sender:Yytsi
Submission time:2019-02-15 14:00:06 +0200
Language:C++
Status:READY
Result:41
Feedback
groupverdictscore
#1ACCEPTED10
#20
#3ACCEPTED12
#4ACCEPTED19
#50
Test results
testverdicttimegroup
#1ACCEPTED0.02 s3, 5details
#2ACCEPTED0.02 s1, 2, 3, 5details
#3ACCEPTED0.03 s1, 2, 5details
#4ACCEPTED0.03 s1, 2, 5details
#5ACCEPTED0.02 s1, 2, 3, 5details
#6ACCEPTED0.02 s1, 2, 5details
#7ACCEPTED0.03 s1, 2, 5details
#8ACCEPTED0.02 s1, 2, 5details
#9ACCEPTED0.02 s1, 2, 5details
#10ACCEPTED0.02 s1, 2, 5details
#11ACCEPTED0.01 s1, 2, 5details
#12ACCEPTED0.02 s1, 2, 5details
#13ACCEPTED0.02 s1, 2, 5details
#14ACCEPTED0.03 s1, 2, 5details
#15ACCEPTED0.02 s1, 2, 5details
#16ACCEPTED0.03 s1, 2, 5details
#17--2, 5details
#18--2, 5details
#19--2, 5details
#200.31 s2, 5details
#21--2, 5details
#22--2, 5details
#23--2, 5details
#24--2, 5details
#25--2, 5details
#26--2, 5details
#270.30 s2, 5details
#280.23 s2, 5details
#290.23 s2, 5details
#300.18 s2, 5details
#310.18 s2, 5details
#32ACCEPTED0.01 s3, 5details
#33ACCEPTED0.03 s3, 5details
#34ACCEPTED0.03 s3, 5details
#35ACCEPTED0.02 s3, 5details
#36ACCEPTED0.03 s3, 5details
#37ACCEPTED0.03 s3, 5details
#38ACCEPTED0.01 s3, 5details
#39ACCEPTED0.01 s3, 5details
#40ACCEPTED0.02 s3, 5details
#41ACCEPTED0.02 s3, 5details
#42ACCEPTED0.32 s4, 5details
#43ACCEPTED0.50 s4, 5details
#44ACCEPTED0.53 s4, 5details
#45ACCEPTED0.17 s4, 5details
#46ACCEPTED0.68 s4, 5details
#47ACCEPTED0.52 s4, 5details
#48ACCEPTED0.49 s4, 5details
#49ACCEPTED0.43 s4, 5details
#50ACCEPTED0.49 s4, 5details
#51ACCEPTED0.56 s4, 5details
#52ACCEPTED0.56 s4, 5details
#53ACCEPTED0.53 s4, 5details
#54ACCEPTED0.55 s4, 5details
#55ACCEPTED0.47 s4, 5details
#56ACCEPTED0.53 s4, 5details
#57ACCEPTED0.54 s4, 5details
#58ACCEPTED0.49 s4, 5details
#59ACCEPTED0.46 s4, 5details
#60ACCEPTED0.08 s2, 4, 5details
#61ACCEPTED0.59 s4, 5details
#62ACCEPTED0.39 s4, 5details
#63ACCEPTED0.13 s4, 5details
#64ACCEPTED0.23 s4, 5details
#65ACCEPTED0.11 s4, 5details
#66ACCEPTED0.13 s4, 5details
#67ACCEPTED0.12 s4, 5details
#68ACCEPTED0.18 s4, 5details
#69ACCEPTED0.11 s4, 5details
#70ACCEPTED0.17 s4, 5details
#71ACCEPTED0.11 s4, 5details
#72ACCEPTED0.17 s4, 5details
#730.50 s5details
#741.15 s5details
#752.22 s5details
#761.91 s5details
#771.33 s5details
#781.14 s5details
#792.24 s5details
#801.47 s5details
#811.60 s5details
#822.41 s5details
#831.34 s5details
#841.01 s5details
#851.29 s5details
#861.63 s5details
#871.66 s5details
#882.25 s5details
#891.74 s5details
#900.17 s5details
#913.00 s5details
#920.37 s5details
#930.30 s5details
#940.19 s5details
#950.23 s5details
#960.17 s5details
#970.23 s5details
#980.14 s5details
#990.11 s5details
#1000.14 s5details
#1010.17 s5details

Code

// yhyyy miksi ei toimi yhyy :'(


#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 101010
int n, m, k;
vector<pll> adj[N];
ll d[N]; // shortest dist to a npp
int vis[N];
int id = 1;
bool npp[N];

bool ok(int a, int b, ll min_w) {
  id++;
  queue<int> q;
  q.push(a);
  while (!q.empty()) {
    int x = q.front(); q.pop();
    for (pll u : adj[x]) {
      if (vis[u.F] == id || d[u.F] < min_w) continue;
      vis[u.F] = id;
      q.push(u.F);
    }
  }

  if (vis[b] == id) return true;
  else return false;
}

ll dijkstra(int x) {
  FOR(i,1,n+1) d[i] = 1e15;
  d[x] = 0;
  priority_queue<pll, vector<pll>, greater<pll>> q;
  q.push({0, x});
  ll mn = 1e15;

  id++;
  while (!q.empty()) {
    int x = q.top().S; q.pop();
    if (vis[x] == id) continue;
    vis[x] = id;
    for (pll u : adj[x]) {
      if (d[x] + u.S < d[u.F]) {
        d[u.F] = d[x] + u.S;
        if (npp[u.F]) mn = min(mn, d[u.F]);
        q.push({d[u.F], u.F});
      }
    }
  }

  return mn;
}

int main() {
  IO; cin>>n>>m;
  FOR(i,0,m) {
    int a,b; ll w;
    cin>>a>>b>>w;
    adj[a].pb({b, w});
    adj[b].pb({a, w});
  }

  FOR(i,1,n+1) d[i] = 1e15;
  priority_queue<pll, vector<pll>, greater<pll>> q;

  cin>>k;
  FOR(i,0,k) {
    int x; cin>>x;
    d[x] = 0;
    npp[x] = true;
    q.push({0, x});
  }

  

  //cout<<ok(3,2,4)<<"\n";
  //FOR(i,1,n+1) cout<<d[i]<<" ";

  int Q; cin>>Q;
  if (Q == 1) goto skip;
  if ((Q > 1000) || (n > 1000)) {
    FOR(i,0,Q) {
      int a,b; cin>>a>>b;
      if (!d[a] || !d[b]) {
        cout<<0<<"\n";
        continue;
      }

      bool friends = false;
      for (pll u : adj[a]) if (u.F == b) friends = true;

      if (friends) {

        cout<<min(dijkstra(a), dijkstra(b))<<"\n";
      }
    }
    return 0;
  }


  skip:
  while (!q.empty()) {
    int x = q.top().S; q.pop();
    if (vis[x] == id) continue;
    vis[x] = id;
    for (pll u : adj[x]) {
      if (d[x] + u.S < d[u.F]) {
        d[u.F] = d[x] + u.S;
        q.push({d[u.F], u.F});
      }
    }
  }

  FOR(i,0,Q) {
    int a,b; cin>>a>>b;
    if (!d[a] || !d[b]) {
      cout<<0<<"\n";
      continue;
    }
    // binary search max dist to npp on path a->b?
    bool friends = false;
    for (pll u : adj[a]) if (u.F == b) friends = true;

    if (friends) {
      cout<<min(d[a], d[b])<<"\n"; continue;
    }
    ll ck = 0;
    for (ll z = min(d[a], d[b]); z >= 1; z /= 2) {
      while (ok(a, b, ck+z) && ok(b, a, ck+z)) ck += z;
    }

    cout<<ck<<"\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:

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

correct output
4493
3124
3584
4203
3352
...

user output
(empty)

Test 18

Group: 2, 5

Verdict:

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

correct output
852
901
1120
1165
1239
...

user output
(empty)

Test 19

Group: 2, 5

Verdict:

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

correct output
1270
1486
1185
1113
1222
...

user output
(empty)

Test 20

Group: 2, 5

Verdict:

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
0
0
...
Truncated

Test 21

Group: 2, 5

Verdict:

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

correct output
1097
717
1251
955
1045
...

user output
(empty)

Test 22

Group: 2, 5

Verdict:

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

correct output
323
0
156
79
0
...

user output
(empty)

Test 23

Group: 2, 5

Verdict:

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

correct output
29396767
21591510
55276964
33539480
72080903
...

user output
(empty)

Test 24

Group: 2, 5

Verdict:

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

correct output
970
711
780
699
716
...

user output
(empty)

Test 25

Group: 2, 5

Verdict:

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

correct output
355
625
766
605
583
...

user output
(empty)

Test 26

Group: 2, 5

Verdict:

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

correct output
55
371
0
341
0
...

user output
(empty)

Test 27

Group: 2, 5

Verdict:

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
0
0
...
Truncated

Test 28

Group: 2, 5

Verdict:

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
0
0
0
...
Truncated

Test 29

Group: 2, 5

Verdict:

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
0
0
0
...
Truncated

Test 30

Group: 2, 5

Verdict:

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
0
0
0
0
...
Truncated

Test 31

Group: 2, 5

Verdict:

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
0
0
0
0
...
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:

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

correct output
2789
2693
2317
2490
2585
...

user output
0
0
3037
2744
0
...

Test 74

Group: 5

Verdict:

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

correct output
943
879
757
840
810
...

user output
0
902
0
619
550
...

Test 75

Group: 5

Verdict:

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

correct output
928
915
909
978
302
...

user output
0
0
883
999
1101
...

Test 76

Group: 5

Verdict:

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

correct output
741
1036
993
553
1057
...

user output
0
0
0
0
0
...

Test 77

Group: 5

Verdict:

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

correct output
876
692
608
407
459
...

user output
0
0
0
0
0
...

Test 78

Group: 5

Verdict:

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

correct output
662
632
594
622
601
...

user output
0
0
0
0
0
...

Test 79

Group: 5

Verdict:

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

correct output
594
954
739
873
953
...

user output
0
0
0
0
783
...

Test 80

Group: 5

Verdict:

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

correct output
596
977
754
830
731
...

user output
0
0
0
0
773
...

Test 81

Group: 5

Verdict:

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

correct output
588
957
831
766
558
...

user output
763
775
0
0
706
...

Test 82

Group: 5

Verdict:

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

correct output
1077
655
838
981
1077
...

user output
0
782
1075
1022
918
...

Test 83

Group: 5

Verdict:

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

correct output
457
426
389
460
518
...

user output
0
0
0
0
0
...

Test 84

Group: 5

Verdict:

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

correct output
215
458
591
147
495
...

user output
0
0
0
0
0
...
Truncated

Test 85

Group: 5

Verdict:

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

correct output
215
314
284
413
301
...

user output
0
0
0
0
0
...
Truncated

Test 86

Group: 5

Verdict:

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

correct output
171
16
110
184
63
...

user output
0
0
0
0
0
...
Truncated

Test 87

Group: 5

Verdict:

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

correct output
505
51
370
297
108
...

user output
0
0
0
0
0
...
Truncated

Test 88

Group: 5

Verdict:

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

correct output
589
751
640
868
540
...

user output
495
605
803
730
495
...

Test 89

Group: 5

Verdict:

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

correct output
1015
996
1150
995
1045
...

user output
1164
984
1139
829
915
...

Test 90

Group: 5

Verdict:

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
0
0
92884559
33991676

Test 91

Group: 5

Verdict:

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

correct output
978
983
634
768
627
...

user output
0
0
0
780
882
...

Test 92

Group: 5

Verdict:

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:

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

correct output
55
55
55
55
55
...

user output
0
0
55
55
55

Test 94

Group: 5

Verdict:

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

correct output
405459
1058750
3569995
3807
2822955
...

user output
4856483
3573858

Test 95

Group: 5

Verdict:

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

correct output
1
1
1
1
1
...

user output
0
0
0
0
0
...
Truncated

Test 96

Group: 5

Verdict:

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

correct output
14
14
14
14
14
...

user output
0
0
0
0
0
...

Test 97

Group: 5

Verdict:

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

correct output
1087
0
0
0
159917
...

user output
0
0
0
0
0
...
Truncated

Test 98

Group: 5

Verdict:

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

correct output
0
6434711
9195470
0
0
...

user output
866018
0
0
0
0
...

Test 99

Group: 5

Verdict:

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

correct output
2
2
2
2
2
...

user output
0
0
0
0
0
...
Truncated

Test 100

Group: 5

Verdict:

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
39539378
44825592
0
...

Test 101

Group: 5

Verdict:

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

correct output
23
23
23
23
23
...

user output
0
0
0
0
0
...