QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#624113#4095. 날다람쥐Matutino15 1628ms103708kbC++172.5kb2024-10-09 14:59:432024-10-09 14:59:45

Judging History

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

  • [2024-10-09 14:59:45]
  • 评测
  • 测评结果:15
  • 用时:1628ms
  • 内存:103708kb
  • [2024-10-09 14:59:43]
  • 提交

answer

#include "squirrel.h"
#include<bits/stdc++.h>
#define reg register
#define int long long
inline int min(reg int x,reg int y){return x<y?x:y;}
inline bool cmin(reg int &x,reg int y){return x>y?x=y,1:0;}
inline bool cmax(reg int &x,reg int y){return x<y?x=y,1:0;}
const int N=5e5+10;
int n,mn[N<<2],tag[N<<2],st[20][N],w[N];
inline void brush(reg int o,reg int k){mn[o]+=k,tag[o]+=k;}
inline void pushdown(reg int o){if (tag[o]) brush(o<<1,tag[o]),brush(o<<1|1,tag[o]),tag[o]=0;}
inline void pushup(reg int o){mn[o]=min(mn[o<<1],mn[o<<1|1]);}
void modify(reg int o,reg int l,reg int r,reg int L,reg int R,reg int k){
    if (L<=l&&r<=R) return brush(o,k); reg int mid=l+r>>1; pushdown(o);
    if (L<=mid) modify(o<<1,l,mid,L,R,k); if (R>mid) modify(o<<1|1,mid+1,r,L,R,k); pushup(o);
}
int find(reg int o,reg int l,reg int r,reg int x){
    if (mn[o]>0) return l-1; if (l==r) return l; pushdown(o);
    reg int mid=l+r>>1,t=x>mid?find(o<<1|1,mid+1,r,x):mid;
    return t==mid?find(o<<1,l,mid,x):t;
}
int query(reg int o,reg int l,reg int r,reg int L,reg int R){
    if (L<=l&&r<=R) return mn[o]; reg int mid=l+r>>1,res=1e18; pushdown(o);
    if (L<=mid) cmin(res,query(o<<1,l,mid,L,R)); if (R>mid) cmin(res,query(o<<1|1,mid+1,r,L,R));
    return res;
}
inline int chk(reg int x,reg int y){return w[x]<w[y]?x:y;}
inline int qry(reg int l,reg int r){reg int L=std::__lg(r-l+1); return chk(st[L][l],st[L][r-(1<<L)+1]);}
#undef int
long long fly(std::vector<int> D, std::vector<int> H, std::vector<int> W, int L, int R) {
    #define int long long
    n=D.size(); 
    for (reg int i=1;i<=n;i++) st[0][i]=i,w[i]=W[i-1];
    for (reg int j=1;1<<j<=n;j++) for (reg int i=1;i+(1<<j)-1<=n;i++) st[j][i]=chk(st[j-1][i],st[j-1][i+(1<<j-1)]);
    reg int ans=0; D.push_back(D.back()+R);
    modify(1,1,n,1,1,H[0]-L);
    for (reg int i=2,now=L;i<=n+1;i++){
        reg int d=D[i-1]-D[i-2];
        // std::cerr<<"<< "<<d<<" "<<now<<"\n";
       reg int qwq=0;
        while (now<d){
            // ++qwq; assert(qwq<=4);
            // std::cerr<<"qwq\n";
            reg int L=find(1,1,n,i-1)+1;
            // std::cerr<<L<<" "<<i<<"\n";
            if (L==i) return -1;
            reg int nw=min(query(1,1,n,L,i-1),d-now);
            // std::cerr<<query(1,1,n,3,3)<<"\n";
            reg int id=qry(L,i-1); modify(1,1,n,id,i-1,-nw);
            ans+=w[id]*nw,now+=nw;
        }
        now-=d;
        // std::cerr<<now<<"\n";
        cmin(now,H[i-1]);
        if (i<=n) modify(1,1,n,i,i,H[i-1]-now);
    }    
    return ans;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Time Limit Exceeded

Test #1:

score: 4
Accepted
time: 418ms
memory: 103708kb

input:

500000
0 74201083 0
1894 103949999 0
1976 991641614 0
6829 836886815 0
7228 145466667 0
8362 872980184 0
12946 992583286 0
15616 517178776 0
16265 554052070 0
17815 316840754 0
17968 707530952 0
20234 453750281 0
20430 600152122 0
20883 596429721 0
20904 475724209 0
21127 592035055 0
21432 661316980...

output:

0
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #2:

score: 4
Accepted
time: 51ms
memory: 91356kb

input:

500000
0 992872946 0
259 811956587 0
469 550123431 0
2397 128381855 0
4730 718488908 0
6189 369164617 0
9133 337457335 0
10306 265011040 0
10471 405898782 0
12748 631300989 0
12984 573431455 0
14284 32253024 0
20210 30568121 0
20599 698978409 0
23446 816300753 0
23885 941673503 0
25069 866145199 0
2...

output:

-1
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #3:

score: 4
Accepted
time: 31ms
memory: 91500kb

input:

500000
0 61287913 0
690 665187368 0
781 403572543 0
1651 860068383 0
2054 996543853 0
5677 715605946 0
6248 387364087 0
6656 457553703 0
8128 257745494 0
8837 650793929 0
10048 439331958 0
11218 50947254 0
13825 606208312 0
16388 946751289 0
16392 451844593 0
18200 586279248 0
19879 925749226 0
2406...

output:

-1
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #4:

score: 0
Time Limit Exceeded

input:

500000
0 103400 0
772 6145 0
1414 183504 0
5066 187069 0
5891 79363 0
7491 117644 0
9622 118377 0
10097 116975 0
12404 109700 0
13725 169198 0
16882 13919 0
17883 104432 0
23188 160382 0
24199 129066 0
26818 115866 0
27382 156598 0
28717 136194 0
28894 151222 0
30661 72164 0
30896 51701 0
31421 1647...

output:

Unauthorized output

result:


Subtask #2:

score: 0
Time Limit Exceeded

Test #16:

score: 13
Accepted
time: 2ms
memory: 10176kb

input:

3
0 8 1
2 4 1
4 9 1
7 5

output:

3
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #17:

score: 13
Accepted
time: 0ms
memory: 10148kb

input:

3
0 8 1
3 6 1
5 9 1
7 0

output:

0
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #18:

score: 13
Accepted
time: 696ms
memory: 103636kb

input:

500000
0 880898257 1
449 697805005 1
832 732167074 1
1215 76849645 1
1235 794467866 1
1420 214671183 1
5637 797829256 1
8769 882665474 1
9532 129301213 1
10004 585069308 1
12187 307040559 1
15062 932082580 1
15573 153996345 1
16803 883017734 1
17855 868527578 1
21933 326154227 1
26329 938464658 1
26...

output:

694100402
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #19:

score: 13
Accepted
time: 457ms
memory: 103632kb

input:

500000
0 949313224 1
536 846003081 1
571 290648891 1
953 808536173 1
2120 367490107 1
4604 710855616 1
4945 287927496 1
6989 485273546 1
7221 981147924 1
7467 194496840 1
10881 172941062 1
11386 510585322 1
11560 729636537 1
11810 130790614 1
12180 504071418 1
13051 970759971 1
14859 143292877 1
150...

output:

934838048
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #20:

score: 13
Accepted
time: 601ms
memory: 103336kb

input:

500000
0 156184140 1
3054 622527975 1
3208 516548797 1
5692 247545111 1
7508 13127422 1
17512 67126270 1
18016 190688043 1
19968 156456297 1
21064 386558439 1
21986 144704235 1
23086 70168788 1
23319 268167517 1
24038 667094814 1
27637 604168024 1
29680 391816689 1
33374 916670397 1
35434 801630974 ...

output:

-1
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #21:

score: 0
Time Limit Exceeded

input:

500000
0 75576 1
383 81438 1
2642 79979 1
10372 76365 1
10690 18055 1
11884 13518 1
13146 86022 1
13902 136109 1
16874 35181 1
18010 122565 1
19529 92479 1
22776 50832 1
23520 51645 1
24383 124785 1
25441 124006 1
28632 97752 1
32905 158390 1
38134 65706 1
40554 85608 1
43884 136910 1
44535 139427 1...

output:

Unauthorized output

result:


Subtask #3:

score: 0
Skipped

Dependency #1:

0%

Subtask #4:

score: 15
Accepted

Test #54:

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

input:

3
0 5 3
2 6 2
8 4 1
4 2

output:

10
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #55:

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

input:

500
0 36 477870592
1 49 225118723
2 12 305549731
3 50 199782350
4 12 621067277
5 17 634339441
6 33 724737436
7 44 600042161
8 50 270266672
9 45 325722239
10 24 344756214
11 47 280078638
12 31 289312397
13 30 577859437
14 29 99532301
15 12 765519665
16 14 729669577
17 33 859013484
18 45 377019268
19 ...

output:

29696474768
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #56:

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

input:

500
0 44 435213639
1 30 653422811
2 14 397819976
3 25 81288885
4 14 534643415
5 40 727614621
6 34 232508110
7 29 937246678
8 26 809838502
9 19 671612396
10 23 440663685
11 34 636252166
12 40 408340232
13 45 295446844
14 34 78416008
15 29 349723822
16 28 862774834
17 49 221362227
18 21 21820877
19 27...

output:

29797101974
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #57:

score: 15
Accepted
time: 4ms
memory: 24268kb

input:

500
0 441 299704642
1 402 184439868
2 413 315891467
3 438 4619197
4 413 97959310
5 458 135031882
6 447 644631663
7 458 598160799
8 460 908409753
9 423 826605292
10 429 58028035
11 479 531135263
12 411 630775087
13 467 516908714
14 413 751942403
15 421 805587001
16 472 142636088
17 455 988715678
18 4...

output:

377531566
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #58:

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

input:

500
0 49 252307363
1 16 278103265
2 14 630031893
3 11 614159759
4 40 563438726
5 20 94098384
6 34 211148802
7 47 730449135
8 11 791553775
9 47 277724840
10 38 731011679
11 32 62086840
12 11 686611439
13 30 732517854
14 23 73773462
15 27 231282167
16 47 138084934
17 49 34456523
18 49 898618683
19 26 ...

output:

37131719443
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #59:

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

input:

500
0 26 899534796
1 17 658384741
2 19 822415707
3 35 565209089
4 22 616259168
5 37 904824814
6 50 713249368
7 16 79545272
8 41 540811818
9 37 279724341
10 41 232376586
11 15 654634186
12 15 819454345
13 37 880686491
14 26 402729190
15 33 540141763
16 21 733713365
17 23 885467459
18 43 474582634
19 ...

output:

56170995680
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #60:

score: 15
Accepted
time: 4ms
memory: 24264kb

input:

500
0 32 221856011
1 43 995858974
2 28 885445582
3 32 854188454
4 10 544904994
5 34 381493768
6 44 697261526
7 44 850936766
8 19 638726200
9 11 392155835
10 49 313607609
11 11 223198175
12 31 479208076
13 42 677192213
14 34 167573003
15 12 954946657
16 25 678955345
17 46 602170627
18 28 27989995
19 ...

output:

31176413476
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #61:

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

input:

3
0 4 6
3 2 5
5 6 3
1 5

output:

37
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #62:

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

input:

500
0 71 429651037
1 210 383157805
2 97 460639973
3 106 389018740
4 180 25973521
5 373 538897675
6 13 11985764
7 41 480153390
8 190 935155535
9 253 981210408
10 153 962360737
11 278 272348276
12 18 721952635
13 281 719028218
14 86 450661028
15 303 210214190
16 9 617009192
17 484 522228015
18 492 356...

output:

30448080639
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #63:

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

input:

500
0 428 500485592
8 100 197300250
15 364 108570405
26 380 588915252
37 397 49951707
47 330 292289816
49 28 448671433
56 294 955843868
59 332 582823449
70 45 182269427
76 79 954919975
87 139 126851350
92 301 15253544
109 93 996158484
112 47 519790654
120 80 505158751
123 81 126032837
128 192 279653...

output:

274501237781
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #64:

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

input:

500
0 431 745479530
431 284 850980730
715 213 235632174
928 65 971032611
993 433 569263662
1426 409 829062540
1835 264 964926070
2099 192 820602707
2291 295 903440082
2586 42 502842333
2628 191 784029969
2819 4 683354774
2823 162 629309040
2985 381 405080164
3366 403 530687
3769 135 175221360
3904 4...

output:

60139981187136
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #65:

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

input:

500
0 158 917152382
158 289 230796878
447 232 615674787
679 406 459941193
1085 429 176201473
1514 362 126087038
1876 452 610168273
2328 80 624298248
2408 358 326204004
2766 25 389398823
2791 254 988502886
3045 310 126397614
3355 32 929820592
3387 177 465824887
3564 43 741996373
3607 249 605671709
38...

output:

-1
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #66:

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

input:

500
0 500 132715729
500 500 94222202
1000 500 147360684
1500 500 261881649
2000 500 683235219
2500 500 198866036
3000 500 39238416
3500 500 998348130
4000 500 648721066
4500 500 505617606
5000 500 963233836
5500 500 487930771
6000 500 193062799
6500 500 257710331
7000 500 209618684
7500 500 21785938...

output:

120051724124500
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #67:

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

input:

500
0 414 271307969
34 90 645852394
64 458 579635487
109 41 963993829
139 106 285474598
180 112 527740248
228 150 944918995
264 430 276710575
314 425 747832721
347 316 807590178
394 364 929818023
440 421 255864635
485 54 43360954
525 79 508850682
570 304 701770689
605 80 990659862
646 413 11580470
6...

output:

4284484287502
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #68:

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

input:

500
0 201 328897141
180 188 673224188
336 291 76865482
502 219 993523720
662 347 600859857
905 251 303270063
1109 359 146159824
1337 349 593224336
1562 189 39518455
1738 295 699616646
1921 264 944996763
2145 400 357634747
2332 396 866874604
2553 395 110201654
2791 435 277532775
2996 272 602848825
32...

output:

41252368861546
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #69:

score: 15
Accepted
time: 2ms
memory: 24540kb

input:

500
0 16 930284288
1 36 952606202
2 36 907267913
3 29 317187438
4 30 990685573
5 15 274792113
6 39 537468898
7 11 936304508
8 31 530779161
9 44 422954416
10 12 328774816
11 39 173982106
12 38 7989018
13 42 365783446
14 28 608659786
15 34 72609336
16 36 763696081
17 44 954531194
18 45 693060480
19 27...

output:

24717625826
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #70:

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

input:

500
0 439 533543232
1 466 312807673
2 410 142716473
3 438 130877491
4 455 426357689
5 485 116553872
6 476 945338453
7 470 57298423
8 434 338783132
9 423 374996767
10 480 314474231
11 494 532623118
12 438 535985690
13 437 469234717
14 451 959312672
15 460 513908749
16 496 24410475
17 439 611070248
18...

output:

4814640656
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #71:

score: 15
Accepted
time: 1ms
memory: 9984kb

input:

2
0 5 522836298
5 8 365727313
1 1

output:

2457072505
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #72:

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

input:

3
0 4 699212936
3 5 314612374
4 4 171789950
2 2

output:

1357405210
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #73:

score: 15
Accepted
time: 2ms
memory: 11992kb

input:

5
0 10 343976639
5 4 843538459
8 1 731022891
9 5 993586008
10 12 552904230
5 8

output:

6792726404
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #74:

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

input:

7
0 1 24853831
1 3 342978906
3 5 50230379
5 2 196479721
6 7 283136311
13 5 124100992
15 8 704647351
1 3

output:

3206202154
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Subtask #5:

score: 0
Time Limit Exceeded

Dependency #4:

100%
Accepted

Test #75:

score: 18
Accepted
time: 4ms
memory: 34824kb

input:

5000
0 664229261 991789980
37309 903348912 448669762
145424 90814466 999627840
250769 705143177 707665230
457992 991409393 173136785
723434 616050538 428560142
1028113 553286097 737916858
1241678 385224973 415817996
1427983 633679035 819747705
1490999 558914573 205396343
1520347 52287727 226811443
1...

output:

7560531030724308
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #76:

score: 18
Accepted
time: 3ms
memory: 32752kb

input:

5000
0 890764377 1000000000
23 846669458 1000000000
37 594603565 1000000000
50 804425865 1000000000
57 525782476 1000000000
91 818194609 1000000000
113 993771911 1000000000
123 575809609 1000000000
127 506904576 1000000000
148 957824311 1000000000
195 673715930 1000000000
272 844336742 1000000000
27...

output:

593329353000000000
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #77:

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

input:

5000
0 946878710 952244166
245888 960687347 904095464
295977 930898077 957646237
363913 922325320 968187549
372134 939120861 916835415
444680 998527571 965590284
532280 981014285 901950293
665837 904942340 956052949
756752 923935209 947871687
871037 923593652 928189088
1545137 942858795 908488565
16...

output:

1598700168146067702
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #78:

score: 18
Accepted
time: 2ms
memory: 37164kb

input:

5000
0 5098892 691532524
23736 11045732 463235546
88126 12689477 34406815
172162 2955054 219566738
268935 2859006 768026185
766061 4065418 697117661
941439 12053433 887793377
1337477 11516485 619915143
1510124 2948158 762735649
1535104 8898944 164230412
1848356 7123497 534703501
1935606 8695410 1217...

output:

111009064050586310
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #79:

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

input:

5000
0 66287938 849551692
102830 185397651 888538270
452889 126080106 78198939
706882 54739135 446169915
838622 116027082 31290872
1059733 83563760 555215679
1302261 174779609 530982655
2097630 148974838 342351246
2181335 168030440 187783965
2436187 40201502 1467617
2655179 183830498 55350179
281380...

output:

410236904289637362
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #80:

score: 18
Accepted
time: 2ms
memory: 33064kb

input:

5000
0 244182090 836790516
182896 60449055 974061806
251866 682699364 121964188
263061 832010836 356904386
356085 752492841 657049113
1052817 711349678 29527282
1276509 397241764 83807390
1365857 677755527 368052649
1512716 857770434 246821319
1602458 781388820 610805983
1619672 516490005 274965977
...

output:

242050610686962387
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #81:

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

input:

5000
0 290114 952554519
290114 459131 41791675
749245 43492 548502915
792737 404527 12562174
1197264 48143 874487786
1245407 41499 849976450
1286906 12303 429692672
1299209 770538 598527241
2069747 388385 488509898
2458132 394973 297618481
2853105 863964 734993646
3717069 196046 958672189
3913115 61...

output:

627896684829820040
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #82:

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

input:

5000
0 134487 983089052
134487 272810 338286027
407297 335280 217003443
742577 394785 601942559
1137362 258887 426632082
1396249 109741 363975791
1505990 132464 682684190
1638454 12584 935610015
1651038 50920 819276280
1701958 254907 157999311
1956865 96652 411825836
2053517 306406 488079488
2359923...

output:

-1
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #83:

score: 18
Accepted
time: 3ms
memory: 32832kb

input:

5000
0 1000000000 919942662
200000 1000000000 685273236
400000 1000000000 37767862
600000 1000000000 43796671
800000 1000000000 606341555
1000000 1000000000 544997254
1200000 1000000000 70643583
1400000 1000000000 572363309
1600000 1000000000 632086612
1800000 1000000000 993105415
2000000 1000000000...

output:

4718119728600000
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #84:

score: 18
Accepted
time: 9ms
memory: 32760kb

input:

5000
0 325185 620650213
200000 213133 289619639
400000 354497 964881658
600000 286139 650942272
800000 358217 699822628
1000000 318555 39780917
1200000 327033 793550832
1400000 264502 321869505
1600000 310309 978748552
1800000 396236 621665748
2000000 202839 275189388
2200000 350479 238854489
240000...

output:

410886911088182607
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #85:

score: 18
Accepted
time: 11ms
memory: 32704kb

input:

5000
0 18287 196135808
1549 19731 567827043
3555 18033 696281149
5644 7615 706397401
7229 19846 909711227
9159 15423 287565285
11094 6548 893296019
13291 7308 801851916
14970 19935 206874112
16881 2230 364890405
18384 5823 639070072
20411 20021 688941084
22156 19383 379486881
23743 16481 998729119
2...

output:

100465789191860682
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #86:

score: 18
Accepted
time: 1628ms
memory: 32792kb

input:

5000
0 2909 870637903
1727 2544 308863019
3274 2168 221446565
4778 2117 911626945
6425 3574 13336132
8382 2508 558098620
10333 1824 186134622
11957 3516 569629462
14071 2931 319732026
16047 2137 246681696
18013 2512 209272860
19924 2157 226495099
22080 2564 841266536
23639 3052 800680237
25245 3649 ...

output:

119315639713842289
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #87:

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

input:

5000
0 26 958526698
1 29 74344261
2 16 611065955
3 43 574450286
4 30 679089615
5 25 213539426
6 49 21465481
7 30 271176328
8 35 213164960
9 27 162594709
10 12 691645688
11 30 688358809
12 24 636282359
13 10 459025504
14 46 967357418
15 48 399070271
16 34 96149947
17 44 461059979
18 34 722220758
19 2...

output:

287422522034
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #88:

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

input:

5000
0 4811 888264254
1 4039 996170659
2 4221 465937428
3 4321 521046357
4 4580 940740137
5 4830 795554174
6 4378 611234094
7 4594 344321172
8 4546 997762958
9 4941 555501875
10 4600 424237268
11 4927 302990756
12 4595 687476126
13 4178 808510134
14 4334 409538366
15 4750 167199662
16 4992 908790452...

output:

556702255911
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #89:

score: 18
Accepted
time: 4ms
memory: 32772kb

input:

5000
0 1819902 250934199
506 711387 277729558
587 48860 804499187
1237 199747 395506423
1558 1868273 320898730
1873 1427342 404144772
2262 1202454 578824850
2321 318123 217797194
2722 1306405 941520959
3755 699932 677676253
3975 136189 124630848
4897 1815709 853396453
4925 269428 251601408
5132 1683...

output:

1152706595749907
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #90:

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

input:

5000
0 65649 129774811
22948 15601 170727109
249037 79585 914327461
436353 31935 369075007
730818 50816 350564464
919299 66632 406287347
930967 54459 379639625
1158790 29427 664719415
1259543 57843 426442582
1360820 31068 787984386
1442462 49406 821092581
1539116 58897 698198203
1564415 67782 382377...

output:

-1
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #91:

score: 18
Accepted
time: 3ms
memory: 36972kb

input:

5000
0 97035 658867071
449 3069 354593733
780 46085 652547760
2354 66270 611168273
2400 44974 988113050
2900 60462 409793880
4023 65193 990162125
4605 56002 937035329
5208 37435 817282488
5598 76212 924656417
5978 26737 590311208
6121 93536 305661223
6353 54426 996615295
7639 41640 463809613
8141 82...

output:

-1
jP0CvdiJvC0xnBnhWA0Okzbk
OK

result:

ok 3 lines

Test #92:

score: 0
Time Limit Exceeded

input:

5000
0 115 814645959
3 142 256176416
7 209 24296037
10 137 672809523
14 178 201520558
18 126 20363712
21 153 291861793
25 139 918728610
28 133 639696107
33 82 205945234
36 185 518998828
40 215 592378947
44 129 854023028
48 117 544771816
53 236 273920629
57 94 753120229
62 186 723782939
67 108 950912...

output:

Unauthorized output

result:


Subtask #6:

score: 0
Skipped

Dependency #1:

0%