QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#527213#6330. XOR Reachablesolar_express#WA 362ms152384kbC++202.3kb2024-08-22 12:12:482024-08-22 12:12:49

Judging History

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

  • [2024-08-22 12:12:49]
  • 评测
  • 测评结果:WA
  • 用时:362ms
  • 内存:152384kb
  • [2024-08-22 12:12:48]
  • 提交

answer

#include<bits/stdc++.h>
#define N 100005
#define ll long long 
using namespace std;
int n,m,K,Q;
int rt,tot,ch[N*60][2];
ll ans[N*60],curans;
vector<pair<int,int> > tr[N*60];
void push(int &x,pair<int,int> e){
    if(!x) x=++tot;
    // cerr<<"new "<<x<<endl;
    tr[x].push_back(e);
}
void solve(int &x,int val,int dep,pair<int,int> e){
    if(!x) x=++tot;
    if(dep==-1){
        tr[x].push_back(e);
        // cerr<<x<<endl;
        return;
    }
    int c=(val>>dep)&1;
    if(K&(1<<dep)){
        // cerr<<x<<" fk "<<dep<<endl;
        // cerr<<(c^1)<<endl;
        push(ch[x][c],e);
        solve(ch[x][c^1],val,dep-1,e);
    }else{
        // cerr<<c<<endl;
        solve(ch[x][c],val,dep-1,e);
    }
}
int fa[N],siz[N];
int find(int x){
    return x==fa[x]?x:find(fa[x]);
}
struct node{
    int pos,fa,siz;
};
void dfs(int x,int dep){
    ll oans=curans;
    vector<node> tmp;
    for(auto e:tr[x]){
        int a=e.first,b=e.second;
        a=find(a),b=find(b);
        if(siz[a]<siz[b]) swap(a,b);
        if(a!=b){
            tmp.push_back((node){a,fa[a],siz[a]});
            tmp.push_back((node){b,fa[b],siz[b]});
            fa[b]=a;
            curans-=1ll*siz[a]*siz[a]+1ll*siz[b]*siz[b];
            // assert(curans>=0);
            siz[a]+=siz[b];
            curans+=1ll*siz[a]*siz[a];
        }
    }
    ans[x]=curans;
    if(ch[x][0]&&dep>=0) dfs(ch[x][0],dep-1);
    if(ch[x][1]&&dep>=0) dfs(ch[x][1],dep-1);
    curans=oans;
    for(int i=tmp.size()-1;i>=0;--i){
        int p=tmp[i].pos;
        fa[p]=tmp[i].fa;
        siz[p]=tmp[i].siz;
    }
}
ll qry(int x,int val,int dep){
    // cerr<<x<<endl;
    if(dep==-1) return ans[x];
    // for(auto e:tr[x])
    //     cerr<<dep<<" "<<e.first<<" "<<e.second<<endl;
    int c=(val>>dep)&1;
    if(ch[x][c]) return qry(ch[x][c],val,dep-1);
    else return ans[x];
}
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin>>n>>m>>K;
    --K;
    for(int i=1;i<=m;++i){
        int a,b,c;
        cin>>a>>b>>c;
        solve(rt,c,29,make_pair(a,b));
    }
    for(int i=1;i<=n;++i) fa[i]=i,siz[i]=1;
    curans=n;
    dfs(rt,29);
    cin>>Q;
    for(int i=1;i<=Q;++i){
        int v;
        cin>>v;
        cout<<(qry(rt,v,29)-n)/2<<'\n';
    }
    return 0;
}
/*
4 3 5
1 3 4
2 4 3
3 4 5
1
0
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 5612kb

input:

4 5 5
1 2 17
1 3 4
2 3 20
2 4 3
3 4 5
4
0
7
16
167

output:

2
6
3
0

result:

ok 4 number(s): "2 6 3 0"

Test #2:

score: 0
Accepted
time: 5ms
memory: 5684kb

input:

9 13 488888932
2 7 771479959
3 8 783850182
5 7 430673756
6 8 350738034
4 9 400768807
2 3 83653266
1 2 829786563
5 8 357613791
7 9 579696618
3 7 423191200
3 5 867380255
1 9 907715012
6 9 1033650694
8
498260055
144262908
117665696
848664012
983408133
32610599
478007408
134182829

output:

16
7
5
13
13
16
16
5

result:

ok 8 numbers

Test #3:

score: 0
Accepted
time: 216ms
memory: 119544kb

input:

446 99235 764320136
1 2 467639025
1 39 240791819
1 197 320023434
1 391 968343602
1 116 841220144
1 345 697806443
1 409 489643820
1 339 733516272
1 89 560099922
1 431 722346703
1 433 246809211
1 344 769002876
1 234 597076758
1 178 505730391
1 75 826728597
1 74 14756981
1 63 280238017
1 288 638627144
...

output:

99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
...

result:

ok 100000 numbers

Test #4:

score: 0
Accepted
time: 195ms
memory: 122984kb

input:

443 100000 587238331
315 322 662401332
43 315 536337643
315 404 1008807430
140 315 116993236
315 349 456757176
315 421 208121145
222 315 165949374
315 359 652820576
128 315 366321131
219 315 385302776
279 315 758612678
315 369 524221824
315 418 405097334
315 344 159069559
114 315 1020799146
36 315 4...

output:

97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
97903
...

result:

ok 100000 numbers

Test #5:

score: 0
Accepted
time: 177ms
memory: 102132kb

input:

446 99235 319005349
63 98 45774435
98 419 537824294
55 98 970456100
98 295 177258162
98 148 503686739
98 355 952389094
98 110 672181282
98 113 718706403
98 222 193797576
79 98 367361921
8 98 82995994
13 98 401334976
98 427 695043885
98 366 595065071
98 161 581346320
98 128 792799449
98 178 566239903...

output:

99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
99235
...

result:

ok 100000 numbers

Test #6:

score: 0
Accepted
time: 185ms
memory: 105872kb

input:

442 100000 203918091
334 408 765591331
65 334 841282977
34 334 774464729
135 334 790897433
118 334 220810832
334 383 37271884
334 357 975552850
334 424 634443624
330 334 811688196
321 334 48524877
280 334 40028159
251 334 193460453
198 334 689798118
146 334 734763167
326 334 899636923
89 334 1067215...

output:

97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
97461
...

result:

ok 100000 numbers

Test #7:

score: 0
Accepted
time: 242ms
memory: 109656kb

input:

100000 99999 131080539
55331 77587 680598826
74630 82197 773435840
9490 88468 37670073
8680 59512 493328849
38978 96144 563550542
41963 66970 73513321
1494 85761 799508674
11271 31250 1022044318
39311 99039 1054195469
26320 50975 6951442
3560 84539 467850296
32918 83458 159835633
9576 55206 85302837...

output:

15096
14956
15004
14891
15137
14885
15410
15089
15502
15087
15083
14905
15143
15137
15104
15163
15143
15111
15090
15190
15187
15156
14992
15150
15100
15082
14919
14952
15047
15120
15117
14992
14990
15087
15411
14916
15092
15133
15139
15130
14910
15184
15132
15122
15105
15210
14939
15173
14829
15455
...

result:

ok 100000 numbers

Test #8:

score: 0
Accepted
time: 362ms
memory: 152384kb

input:

99248 100000 880016512
9609 60188 1029518407
67457 77348 128441060
8850 51205 291062482
9624 19858 873440302
20602 31653 646044502
60977 74199 403271514
77359 98694 422310541
18100 53413 641772941
31582 84949 147530174
20254 46153 615653756
78917 86611 850029098
1309 67868 867784476
96643 98988 2712...

output:

5879363
7746507
9770252
7878863
4967006
5004278
4977178
4462464
4171192
4889527
9480939
4983900
5303714
6557680
6810967
13375644
5057196
7210193
6272443
6998946
6557952
4869510
4462624
5179208
5002020
8220896
4489581
7017776
9264220
4838591
8881657
5606801
6164119
6939146
4997590
6840650
5164401
554...

result:

ok 100000 numbers

Test #9:

score: 0
Accepted
time: 346ms
memory: 140296kb

input:

100000 99999 780251002
27269 79999 468071962
21739 82319 682546466
8544 67158 927078439
41968 89207 892254915
48895 55914 193589771
811 49765 490891662
16872 46729 638680406
17867 44058 1070155835
10241 98888 957737438
2201 46513 627847434
21108 88949 186267330
51802 94981 1008817703
20063 25385 676...

output:

851649
896751
856223
866092
859330
890327
903448
864667
873749
844234
887957
862832
833840
905858
833512
864850
890697
875940
877015
889585
919407
899670
879354
835757
889043
891332
909448
910965
855701
898062
868582
884660
898820
827552
858726
865812
887067
893299
882047
902597
880316
836660
868968...

result:

ok 100000 numbers

Test #10:

score: 0
Accepted
time: 263ms
memory: 105316kb

input:

99806 100000 506098337
11316 29606 1053169611
432 77576 188106174
60898 63565 97507616
2948 56878 759293962
57945 69338 892503621
46617 98850 666735935
8904 20788 54696907
42854 49896 442509177
55987 59613 499913803
2227 46042 620057838
1275 36485 557003410
67033 68875 81080762
22626 80910 375900469...

output:

142524
143221
141571
141415
141524
142903
143150
143834
142172
143779
142631
141438
143293
143212
143554
142975
142308
143115
143789
145039
145108
143357
142820
142972
143680
143486
142794
143012
141832
141238
143252
141992
143985
143054
143789
143443
143073
141272
143134
141352
142940
143778
143199...

result:

ok 100000 numbers

Test #11:

score: 0
Accepted
time: 339ms
memory: 121744kb

input:

100000 99999 880261730
49362 60034 719788352
49362 82351 832947612
79673 82351 727350251
79673 98801 931190441
83274 98801 44235181
21205 83274 530387154
19108 21205 173298793
19108 91835 42875759
27763 91835 658199843
27698 27763 541513285
27698 69932 660043688
51737 69932 28343715
51737 64682 7092...

output:

463133
455785
451937
457179
465888
460719
456177
451132
460492
449885
456575
457673
455205
452446
453629
450871
454195
452710
452761
454742
448762
462880
454503
450564
457018
457173
446406
455921
452926
449909
455853
452542
457657
449390
451219
455492
460180
454384
451712
451310
457955
450590
453810...

result:

ok 100000 numbers

Test #12:

score: 0
Accepted
time: 278ms
memory: 117164kb

input:

99280 100000 664494301
16664 29169 599202135
16664 23186 47757770
23186 47063 53266202
47063 85549 1072849246
63153 85549 506433067
63153 80308 580031399
51234 80308 348201803
51234 73193 964438190
73193 84836 959143019
13056 84836 425988976
13056 24417 378109570
332 24417 407996769
332 15544 127696...

output:

169861
168547
170195
167590
167947
171070
169400
169439
168358
168772
169763
168179
170227
169694
170376
170362
170270
168542
168205
170671
170992
167808
170218
169766
169488
169765
169621
169346
170434
169658
168462
167814
168089
169909
169162
169769
169559
169763
171592
170886
168176
170407
170956...

result:

ok 100000 numbers

Test #13:

score: 0
Accepted
time: 270ms
memory: 126404kb

input:

100000 99999 387919793
43583 94512 58705781
10271 43583 170607984
10271 32855 106243875
16854 32855 410273584
3517 16854 890474326
3517 30975 1001361623
20910 30975 1002711314
20910 35013 187670767
32382 35013 239178409
18343 32382 649107746
18343 98413 178223318
98413 99691 35024867
52041 99691 870...

output:

55965
57403
55280
57482
55332
57469
55577
56542
55629
55614
57389
56900
56227
55407
56343
56292
55715
55744
55868
55483
56329
56020
55483
56524
55703
57237
55332
55946
56013
55305
56717
56599
56629
57509
57456
56122
57308
56593
55645
55568
57383
55493
55754
55628
55604
55622
55635
57476
56916
55462
...

result:

ok 100000 numbers

Test #14:

score: 0
Accepted
time: 299ms
memory: 131480kb

input:

99215 100000 802557726
18718 91317 755608910
18718 63717 531481378
30529 63717 642051004
30529 98706 599162314
42379 98706 1033145474
12300 42379 475403483
12300 12338 704395523
12338 98081 711250138
57669 98081 696479725
3890 57669 159898669
3890 64697 759770705
64697 85928 251213884
11945 85928 50...

output:

325883
325574
325225
327438
326494
328594
325193
325522
326677
325193
326907
327836
326189
325885
325339
326122
325379
327013
327616
326596
326962
324792
325751
325773
325810
326287
327825
325773
327896
326283
327310
325931
326309
326164
324663
326225
324826
325760
327847
325563
326191
325762
325419...

result:

ok 100000 numbers

Test #15:

score: 0
Accepted
time: 269ms
memory: 115164kb

input:

100000 99999 402174476
58524 93393 539162433
24909 58524 573965219
58524 88865 99051060
58524 97907 525721613
28122 58524 520563970
18857 58524 305560747
492 58524 1044154487
58524 84138 410295914
4924 58524 880315377
58524 79039 763682384
58524 88879 903645824
58524 84125 286649901
58524 98278 1032...

output:

698949966
700146910
701756916
705846378
701831845
702281503
705808806
702056656
696820446
701906778
701307426
702656328
703631341
701831845
701157628
700371451
701569611
696745785
702056656
699884991
702918765
705696096
696633801
698763036
699361300
701831845
700221753
699697936
706184571
701831845
...

result:

ok 100000 numbers

Test #16:

score: 0
Accepted
time: 288ms
memory: 139248kb

input:

99105 100000 921189055
27602 89467 871564070
73578 89467 892334196
33998 89467 730765033
42525 89467 490770744
10543 89467 48350959
23444 89467 648340211
63556 89467 691268936
37607 89467 427726217
32870 89467 435269802
72115 89467 999718290
6379 89467 905774706
15973 89467 135638767
21262 89467 507...

output:

3624792969
3624537532
3643719678
3643634305
3618665147
3626070240
3637831762
3625899923
3623005143
3633482900
3636722982
3624878103
3623686166
3634676446
3624878103
3641159125
3633056681
3642695343
3624111830
3635529104
3643805044
3628795853
3634676451
3624537530
3637917064
3633482900
3643463575
361...

result:

ok 100000 numbers

Test #17:

score: 0
Accepted
time: 252ms
memory: 117068kb

input:

100000 99999 679882689
58387 94702 419316719
58387 74538 804700023
13639 58387 516717865
16355 58387 648000582
58387 85987 676587546
58387 92832 904327018
43945 58387 30482169
38016 58387 1000125878
52242 58387 619949646
19644 58387 464625256
58387 91871 902831480
45768 58387 337695617
38323 58387 4...

output:

2009114355
2016474265
2014379128
2011967895
2009304528
2031744385
1979557581
1988691711
2001451546
1998289371
2009114355
2028749451
2027857770
2003793165
2003033571
2011714165
2012792628
1989196275
1996014153
2017363440
1978802595
2017172886
1988250270
2014886940
2007403203
2016855316
2018443416
200...

result:

ok 100000 numbers

Test #18:

score: 0
Accepted
time: 298ms
memory: 133644kb

input:

99696 100000 433484222
15535 74820 193053771
49557 74820 196842880
62381 74820 79212906
31117 74820 833959008
70718 74820 649262218
56860 74820 246344682
8631 74820 169957827
2310 74820 732900575
74820 99284 739555015
3447 74820 475010097
3388 74820 969377946
2388 74820 807590871
22132 74820 6319663...

output:

817231837
807155976
817353130
805148295
818283320
823672609
801700936
816181034
803423686
808241162
821522883
825662602
805469360
799980048
802101417
819052136
825581331
822252666
816746769
818687912
815696277
820469325
819294995
801300576
800980347
819537890
817717054
819497405
804305809
821198640
...

result:

ok 100000 numbers

Test #19:

score: 0
Accepted
time: 280ms
memory: 118408kb

input:

100000 100000 1062032266
22211 48279 1060026482
22632 32390 842951551
10268 83993 951617844
91592 98922 845778447
77149 98853 763688613
56053 70280 244874876
22196 95617 372895509
66924 83740 45318731
70188 73104 119729078
35836 80723 344470318
95564 95679 904924735
14097 52566 262568441
28651 61121...

output:

3127582096
3131062861
3128689474
3134941482
3131379418
3131616891
3131854344
3132883264
3132408375
3130509068
3129401273
3132804102
3132329149
3135970889
3124498358
3130746315
3130983793
3132804078
3130350781
3130113326
3129243176
3132883098
3135099896
3122364576
3127344806
3130508993
3135812628
313...

result:

ok 100000 numbers

Test #20:

score: 0
Accepted
time: 326ms
memory: 147968kb

input:

99672 99625 1054752250
28289 45884 626685976
4717 47248 290819812
28968 44157 637912934
38939 97492 767973161
10545 96579 399966947
4703 57028 196340670
71905 85157 481531139
23842 25551 376399599
50355 71552 202579985
12815 27787 958119286
53610 83405 976519803
3487 65277 1038562227
8992 45160 2391...

output:

3074346209
3072307904
3071915787
3073405056
3071602289
3078268101
3064474173
3084390900
3075051889
3073640515
3072464530
3074659640
3078817056
3083055898
3077640209
3077012677
3080543807
3078346554
3072621341
3071602335
3078346262
3073562137
3080543654
3076855662
3080386874
3072386010
3069878213
307...

result:

ok 99138 numbers

Test #21:

score: 0
Accepted
time: 313ms
memory: 127604kb

input:

99628 99396 492500659
46329 97186 745686192
16150 85274 107579031
7130 80654 6325319
2286 62141 498958770
10800 69611 477586530
948 53379 170814235
7607 51421 942502255
55520 73939 170098739
15348 45463 341123290
1751 38059 711970002
91398 94258 146749262
48069 87794 589000897
46795 71115 386715121
...

output:

687296
580675
478093
502923
648657
706361
465786
516267
471330
480159
478562
459914
695621
458335
485458
678024
628524
539316
473246
466375
500790
632511
538974
527869
621100
463319
565062
462236
500956
529041
629276
556694
505979
463414
582871
450617
538511
555928
484537
537287
646089
536225
452939...

result:

ok 99010 numbers

Test #22:

score: 0
Accepted
time: 245ms
memory: 109296kb

input:

99302 99853 197249381
49172 50946 637696889
83639 83821 511956365
9956 71695 944889669
5721 63910 35668351
68079 81135 1053490245
13095 81514 422668799
15919 18518 255609468
27120 52506 424576273
2870 82057 5692084
56922 85467 1011012440
74100 74854 1017906700
45588 55972 990996195
159 46033 7872695...

output:

29223
29124
29166
28840
28923
28636
28414
29187
29160
28616
28848
28565
29168
28547
28679
29239
28952
29035
28721
29303
29344
28781
28599
28902
28630
28439
29468
29125
29449
29376
28583
29481
29387
28319
28826
29177
28315
29409
28408
29185
28430
28950
28337
28940
28421
28925
28492
29265
28674
28405
...

result:

ok 99117 numbers

Test #23:

score: 0
Accepted
time: 271ms
memory: 122152kb

input:

99011 99031 607400868
48014 76110 754021063
2616 81083 681648181
22861 56121 932401683
83596 88114 607083940
32183 59290 574984702
41837 80837 484173564
40268 91957 326604154
49089 84512 570662918
81089 89238 541773961
23557 41516 933269272
34605 77588 265694051
34399 39330 178362416
16631 75841 351...

output:

243204777
249917140
213968950
235612524
232511777
255320885
222406817
244456738
219028301
242751709
248013415
246512065
237083944
221012419
245095698
227948834
243422906
233830866
249645759
228566869
249535016
219232957
250123995
238597477
252317982
239948766
222662230
252884277
239387661
251754179
...

result:

ok 99644 numbers

Test #24:

score: 0
Accepted
time: 259ms
memory: 108320kb

input:

99040 99859 299514887
14702 55423 320674359
19009 78598 906042375
19070 47924 1025775797
18615 65340 240120670
63838 83312 626941391
52145 79941 841285862
27251 91162 616183829
11793 66085 22122559
53548 77376 868446884
20525 78692 596695526
7151 50845 719623592
14510 40114 372868681
54517 69409 574...

output:

63835
63712
63705
63490
62736
62438
65706
64446
64037
62930
65714
64374
65007
65217
61508
64871
64869
64994
62765
66051
62641
61698
64796
63759
62801
62959
64019
65900
63646
62880
64569
62429
64350
64358
62590
63755
64988
61736
62469
63029
65864
64526
62726
63389
63523
62502
65201
65000
63950
62563
...

result:

ok 99757 numbers

Test #25:

score: 0
Accepted
time: 306ms
memory: 128052kb

input:

99889 99805 752076266
9528 68587 887213446
13301 26312 583081741
72271 81654 905609237
6555 23605 297507861
5703 91420 413923311
35199 68640 960922631
2181 62181 405070130
23010 69118 277065506
26620 96673 10075904
74806 97866 262232793
15667 58255 871128648
30827 81359 272250173
11724 56792 8975201...

output:

1312794820
1303894099
1280210251
1306755316
1284666150
1306344913
1305987507
1306653570
1300066138
1319101700
1286845510
1318233584
1300577885
1278136847
1280969167
1300681811
1281981232
1286744595
1296499711
1280414157
1279047373
1308853172
1277130658
1299813614
1282184482
1321109404
1299304538
132...

result:

ok 99696 numbers

Test #26:

score: 0
Accepted
time: 255ms
memory: 117152kb

input:

99258 99262 56019112
66965 95107 978064361
35115 69073 301582582
2675 9305 1027544309
15594 59091 581186820
6695 78180 709218053
37745 64040 251971250
6528 41160 641637561
63165 65678 912097197
10706 52741 913650679
12170 41733 668598040
72501 77687 995907155
42305 95353 8653820
14947 20299 45076413...

output:

5655
5888
5698
5767
5840
5773
5652
5823
5557
5827
5850
5725
5847
5628
5805
5822
5820
5805
5662
5859
5811
5911
5823
5883
5746
5662
5792
5855
5771
5751
5695
5779
5813
5668
5765
5754
5723
5709
5624
5693
5841
5626
5768
5741
5793
5865
5791
5754
5754
5893
5716
5784
5927
5870
5702
5673
5805
5790
5656
5639
...

result:

ok 99953 numbers

Test #27:

score: 0
Accepted
time: 267ms
memory: 112300kb

input:

99140 99097 737534996
19449 24765 536026893
7909 19620 188338802
5541 37064 161805
33807 59256 380484600
16939 40003 453558181
19174 63860 519402672
52537 75690 283335353
4255 27365 895272933
12461 55224 1041724805
44819 60427 436643691
39738 85475 787089381
69284 81496 871830721
31522 50402 6571961...

output:

1198175772
1189782243
1185389165
1189630297
1183491028
1163780151
1194514084
1189585771
1170203410
1188074020
1187680223
1190708922
1184859409
1190459455
1187147343
1201757947
1189288425
1190168464
1183247898
1193195064
1197686357
1176352233
1199203816
1200435105
1183150588
1188068512
1184516727
119...

result:

ok 99688 numbers

Test #28:

score: 0
Accepted
time: 271ms
memory: 135620kb

input:

99788 99502 276157280
20989 33380 580403845
37377 68909 34318010
54685 57378 988117
65058 99474 496512484
9890 16464 934683098
22413 78273 440779516
27372 86900 198152156
60239 64839 162109117
60860 67889 977225714
49384 68253 159646378
24468 73459 27668779
42628 45138 637535004
4991 29338 218630943...

output:

51470
52635
53525
51536
52544
53005
52742
53292
52427
53518
52755
52855
52658
51745
52539
51825
52519
51457
51380
52169
51152
52556
53225
53132
51387
51679
53185
52523
52495
51382
51140
51495
51660
51509
52517
51712
52567
53132
53021
51498
52574
51573
51348
51920
52565
52990
53073
51703
51411
51950
...

result:

ok 99205 numbers

Test #29:

score: -100
Wrong Answer
time: 127ms
memory: 37344kb

input:

99727 100000 0
8048 39782 0
18422 18785 0
26908 35045 0
82687 86306 0
32907 44739 0
67703 82954 0
41964 73171 0
22914 78976 0
21310 31871 0
52664 94128 0
66225 70141 0
4738 66402 0
63535 82871 0
3899 36335 0
3665 48864 0
15138 59325 0
68303 91234 0
20219 29778 0
2618 45656 0
69726 89274 0
4785 29646...

output:

4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
4972687401
497...

result:

wrong answer 1st numbers differ - expected: '0', found: '4972687401'