QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#212847#1976. McFly275307894aAC ✓244ms7004kbC++142.4kb2023-10-13 21:16:042023-10-13 21:16:05

Judging History

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

  • [2023-10-13 21:16:05]
  • 评测
  • 测评结果:AC
  • 用时:244ms
  • 内存:7004kb
  • [2023-10-13 21:16:04]
  • 提交

answer

#include<bits/stdc++.h>
#define Gc() getchar() 
#define Me(x,y) memset(x,y,sizeof(x))
#define Mc(x,y) memcpy(x,y,sizeof(x))
#define d(x,y) ((m)*(x-1)+(y))
#define R(n) (rnd()%(n)+1)
#define Pc(x) putchar(x)
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
using namespace std;using ll=long long;using db=double;using lb=long db;using ui=unsigned;using ull=unsigned long long;using pii=pair<int,int>;using LL=__int128;
const int N=1e5+5,M=N*100+5,K=600+5,mod=998244353,Mod=mod-1;const db eps=1e-6;const int INF=1e9+7;mt19937 rnd(263082);
int n,H,Ns[N],X[N],L[N],R[N];
struct Node{int t,x,dp;}A[N];
namespace BIT{
	int f[N];
	void add(int x,int y){while(x<=n) f[x]=max(f[x],y),x+=x&-x;}
	int qry(int x){int ans=0;while(x) ans=max(ans,f[x]),x-=x&-x;return ans;}
	void Cl(int x){while(x<=n&&f[x]) f[x]=0,x+=x&-x;}
}
bool cmp(Node x,Node y){return x.t<y.t;}
bool cmp1(Node x,Node y){return x.t-Ns[x.x]<y.t-Ns[y.x];}
bool cmp2(Node x,Node y){return x.t+Ns[x.x]<y.t+Ns[y.x];}
void calc(int l,int r){
	if(l==r) return;
	int i,m=l+r>>1,R=l;calc(l,m);
	sort(A+l,A+m+1,cmp1);sort(A+m+1,A+r+1,cmp1);
	for(i=m+1;i<=r;i++) {
		while(R<=m&&A[R].t-Ns[A[R].x]<=A[i].t-Ns[A[i].x]) BIT::add(A[R].x,A[R].dp),R++;
		A[i].dp=max(A[i].dp,BIT::qry(A[i].x-1)+1);
	}
	while(R>l) R--,BIT::Cl(A[R].x);
	/*for(int i=l;i<=m;i++){
		for(int j=m+1;j<=r;j++) if(A[i].t-Ns[A[i].x]<=A[j].t-Ns[A[j].x]&&A[i].x<A[j].x) A[j].dp=max(A[j].dp,A[i].dp+1);
	}*/
	sort(A+l,A+m+1,cmp2);sort(A+m+1,A+r+1,cmp2);
	for(i=m+1;i<=r;i++){
		while(R<=m&&A[R].t+Ns[A[R].x]<=A[i].t+Ns[A[i].x]) BIT::add(n-A[R].x+1,A[R].dp),R++;
		A[i].dp=max(A[i].dp,BIT::qry(n-A[i].x)+1);
	}
	/*for(int i=l;i<=m;i++){
		for(int j=m+1;j<=r;j++) if(A[i].t+Ns[A[i].x]<=A[j].t+Ns[A[j].x]&&A[i].x>A[j].x) A[j].dp=max(A[j].dp,A[i].dp+1);
	}*/
	while(R>l) R--,BIT::Cl(n-A[R].x+1);
	sort(A+m+1,A+r+1,cmp);
	calc(m+1,r);
}
void Solve(){
	int i,j;scanf("%d",&n);
	for(i=1;i<=n;i++) scanf("%d%d%d",&X[i],&L[i],&R[i]),Ns[i]=i;
	sort(Ns+1,Ns+n+1,[](int x,int y){return X[x]<X[y];});
	for(i=1;i<=n;i++) {int p=Ns[i];Ns[i]=X[p];X[p]=i;}
	for(i=1;i<=n;i++) for(j=L[i];j<R[i];j++) A[++H]=(Node){j,X[i],1};
	sort(A+1,A+H+1,cmp);cerr<<"ZJAKIOI"<<'\n';
	calc(1,H);int ans=0;for(i=1;i<=H;i++) ans=max(ans,A[i].dp);printf("%d\n",ans);
}
int main(){
	int t=1;
	// scanf("%d",&t);
	while(t--) Solve();
	cerr<<clock()*1.0/CLOCKS_PER_SEC<<'\n';
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3948kb

input:

4
7 2 5
1 2 4
4 1 6
2 9 10

output:

3

result:

ok single line: '3'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3952kb

input:

3
0 0 11
2 0 11
3 4 9

output:

8

result:

ok single line: '8'

Test #3:

score: 0
Accepted
time: 76ms
memory: 6184kb

input:

29998
503921191 1969062 1969063
504663331 2338422 2338423
506091191 3049062 3049063
502428014 1225914 1225915
500270600 152178 152179
501282471 655782 655783
503888424 1952754 1952755
501295708 662370 662371
506016543 3011910 3011911
502661940 1342338 1342339
504536386 2275242 2275243
505806487 2907...

output:

35004

result:

ok single line: '35004'

Test #4:

score: 0
Accepted
time: 110ms
memory: 5532kb

input:

29996
502831200 1420744 1420745
502841615 503060710 503060711
500083111 501687814 501687815
502121175 502702150 502702151
500770567 502029958 502029959
501983164 998680 998681
500798777 502043998 502043999
503219846 503248954 503248955
500385609 501838366 501838367
503150189 503214286 503214287
5000...

output:

23773

result:

ok single line: '23773'

Test #5:

score: 0
Accepted
time: 89ms
memory: 5400kb

input:

29991
501091511 551992 551993
501911988 500960123 500960124
501170933 500591303 500591304
502168699 1088104 1088105
501101710 500556851 500556852
501123627 500567759 500567760
501075670 500543891 500543892
500989738 501340 501341
502033291 501020495 501020496
501934556 500971355 500971356
501815422 ...

output:

17942

result:

ok single line: '17942'

Test #6:

score: 0
Accepted
time: 44ms
memory: 4600kb

input:

14991
500218086 113542 113543
500379751 194002 194003
500724346 500910288 500910289
500910316 458062 458063
501049196 527182 527183
500174686 91942 91943
500731725 500368961 500368962
500389949 500743860 500743861
500021050 15478 15479
500579608 500293253 500293254
500931364 501013320 501013321
5000...

output:

10442

result:

ok single line: '10442'

Test #7:

score: 0
Accepted
time: 16ms
memory: 4256kb

input:

5286
500084847 500236341 500236342
500193781 500290557 500290558
500351757 500369181 500369182
500340473 500363565 500363566
500014105 500201133 500201134
500313132 500157573 500157574
500007813 500005617 500005618
500123040 500062965 500062966
500087235 45362 45363
500135625 500261613 500261614
500...

output:

4330

result:

ok single line: '4330'

Test #8:

score: 0
Accepted
time: 4ms
memory: 4020kb

input:

1356
500097216 500098285 500098286
500003473 500002035 500002036
500048825 500074201 500074202
500045354 23096 23097
500015624 500057677 500057678
500033853 500017155 500017156
500054033 500076793 500076794
500072044 500085757 500085758
500069223 500084353 500084354
500046656 500023527 500023528
500...

output:

1485

result:

ok single line: '1485'

Test #9:

score: 0
Accepted
time: 0ms
memory: 5880kb

input:

468
500009331 500021943 500021944
500009766 5046 5047
500018880 9582 9583
500030163 500032311 500032312
500015191 7746 7747
500005860 3102 3103
500000869 618 619
500026258 13254 13255
500031899 500033175 500033176
500005643 2994 2995
500029947 15090 15091
500005208 500019891 500019892
500030164 5000...

output:

558

result:

ok single line: '558'

Test #10:

score: 0
Accepted
time: 1ms
memory: 3784kb

input:

108
500000652 500000153 500000154
500001086 586 587
500002388 1234 1235
500001737 500000693 500000694
500006727 500007427 500007428
500004341 500001989 500001990
500004775 500002205 500002206
500007595 500007814 500007859
500000217 500004187 500004188
500004992 2530 2531
500000435 262 263
500003472 ...

output:

138

result:

ok single line: '138'

Test #11:

score: 0
Accepted
time: 1ms
memory: 3840kb

input:

24
500000000 499999783 499999796
500001303 500000445 500000446
500001302 500001643 500001644
500000435 500000013 500000014
500001519 500001738 500001751
500000869 500000229 500000230
500001086 500000337 500000338
500001086 554 555
500001303 662 663
500000434 500001211 500001212
500000651 500001319 5...

output:

42

result:

ok single line: '42'

Test #12:

score: 0
Accepted
time: 1ms
memory: 3780kb

input:

6
500000001 500000218 500000223
500000001 1 6
500000000 500000219 500000224
500000000 0 5
500000000 499999783 499999788
500000001 499999784 499999789

output:

18

result:

ok single line: '18'

Test #13:

score: 0
Accepted
time: 244ms
memory: 6936kb

input:

100000
949995116 889938661 889938662
773378647 981533106 981533107
455682684 25195648 25195649
633269630 368534097 368534098
167228400 910169160 910169161
668060771 247869099 247869100
502923103 400514910 400514911
347407747 776512278 776512279
807336743 220036135 220036136
215220155 563865891 56386...

output:

448

result:

ok single line: '448'

Test #14:

score: 0
Accepted
time: 208ms
memory: 5980kb

input:

50000
691209657 852194101 852194102
256108169 344687892 344687896
133862199 293765312 293765313
423432337 289613081 289613084
112374100 633408682 633408684
869454370 695043078 695043079
476415484 409567960 409567962
551246411 585849303 585849305
438538754 671317574 671317577
756205529 857415793 8574...

output:

321

result:

ok single line: '321'

Test #15:

score: 0
Accepted
time: 146ms
memory: 5396kb

input:

20000
15523296 78863907 78863913
67714599 1299417 1299422
43225598 33316458 33316459
78686878 31165301 31165314
82412002 92936748 92936758
73423803 37676012 37676028
31033643 7544524 7544526
82792461 49032240 49032243
79823451 21757295 21757304
93543489 56524881 56524885
1688026 48829417 48829427
79...

output:

210

result:

ok single line: '210'

Test #16:

score: 0
Accepted
time: 136ms
memory: 7004kb

input:

97598
0 413718 413719
1 328516 328517
1 740210 740211
0 466654 466655
1 332083 332084
0 788987 788988
1 478411 478412
0 833810 833811
0 329228 329229
1 801389 801390
0 581966 581967
1 755845 755846
0 26919 26920
1 782802 782803
0 923614 923615
1 355199 355200
1 881405 881406
1 137843 137844
0 899951...

output:

95257

result:

ok single line: '95257'

Test #17:

score: 0
Accepted
time: 91ms
memory: 5600kb

input:

31679
1 461171 461176
0 78304 78310
1 427304 427310
0 409549 409558
1 949299 949304
1 375884 375887
0 291192 291196
0 323610 323612
0 459582 459583
1 182209 182212
1 986469 986470
1 829338 829339
1 890463 890470
0 805178 805181
1 417399 417401
0 373096 373101
1 746102 746103
1 411400 411401
1 573351...

output:

33017

result:

ok single line: '33017'

Test #18:

score: 0
Accepted
time: 111ms
memory: 5784kb

input:

42839
0 139573 139574
1 766864 766865
1 619331 619333
0 965126 965129
0 277092 277093
0 407310 407311
2 341186 341188
1 280651 280653
1 530622 530624
1 977609 977610
1 99073 99075
0 680179 680181
2 512982 512983
2 103414 103417
1 162879 162881
0 296889 296891
1 315000 315003
0 851329 851331
2 598436...

output:

43544

result:

ok single line: '43544'

Test #19:

score: 0
Accepted
time: 95ms
memory: 5364kb

input:

21607
5 437267 437275
5 385435 385437
2 676501 676513
3 189203 189208
5 896129 896130
5 273128 273132
2 872300 872306
4 379570 379574
5 637543 637544
3 600298 600312
1 261106 261110
2 772845 772849
3 493436 493437
2 531840 531842
3 299008 299010
3 519354 519372
1 215178 215180
5 585761 585764
4 4816...

output:

23123

result:

ok single line: '23123'

Test #20:

score: 0
Accepted
time: 135ms
memory: 5604kb

input:

31793
1 156189 156192
8 46818 46820
10 187450 187452
5 95301 95302
4 86567 86574
3 142878 142880
2 66688 66690
7 107395 107396
8 146872 146874
7 39759 39761
3 155734 155738
3 19813 19816
8 55661 55666
5 194105 194108
0 14000 14003
10 170517 170522
1 138119 138124
9 171539 171541
4 116881 116883
4 18...

output:

27928

result:

ok single line: '27928'

Test #21:

score: 0
Accepted
time: 50ms
memory: 5112kb

input:

193
1 222919 223156
0 251947 252036
0 3899 4614
3 190051 190137
0 232535 233198
1 185112 185442
1 86841 86926
1 442970 443418
1 56559 57875
1 5910 6069
0 296327 296423
2 51661 51905
0 53192 53299
2 452817 453427
0 107941 108522
3 225030 225238
2 234876 235784
3 483005 483138
3 479547 481004
2 239382...

output:

4848

result:

ok single line: '4848'

Test #22:

score: 0
Accepted
time: 149ms
memory: 5292kb

input:

17928
22 102593 102600
33 17558 17566
19 77149 77151
9 186600 186612
10 114286 114291
27 163739 163741
15 83539 83540
84 197 202
36 118625 118632
54 101491 101496
63 2768 2771
6 108868 108869
28 173437 173440
55 830 836
52 15706 15709
61 127923 127926
79 111124 111134
30 48811 48819
92 44265 44273
2...

output:

8552

result:

ok single line: '8552'

Test #23:

score: 0
Accepted
time: 37ms
memory: 4948kb

input:

1
574759694 51531781 51631781

output:

1

result:

ok single line: '1'

Test #24:

score: 0
Accepted
time: 34ms
memory: 5008kb

input:

2
789 269383553 269419176
839 958377697 958442074

output:

2

result:

ok single line: '2'

Test #25:

score: 0
Accepted
time: 43ms
memory: 4972kb

input:

3
987 741422884 741476594
480 521612380 521642806
352 862656471 862672335

output:

3

result:

ok single line: '3'

Test #26:

score: 0
Accepted
time: 38ms
memory: 5112kb

input:

5
466 275528107 275553128
750 106002042 106032104
838 889799264 889820871
130 648741772 648758137
800 543973721 543980666

output:

5

result:

ok single line: '5'

Test #27:

score: 0
Accepted
time: 42ms
memory: 4976kb

input:

10
39 922311595 922316026
232 770840755 770845666
98 388719198 388722363
906 194729045 194746743
707 52138979 52144296
243 770109656 770124909
138 247314379 247314971
618 636497340 636503707
964 853185600 853189146
552 103980954 104019674

output:

10

result:

ok single line: '10'

Test #28:

score: 0
Accepted
time: 42ms
memory: 5024kb

input:

10
39 922311595 922316026
232 770840755 770845666
98 388719198 388722363
906 194729045 194746743
707 52138979 52144296
243 770109656 770124909
138 247314379 247314971
618 636497340 636503707
964 853185600 853189146
552 103980954 104019674

output:

10

result:

ok single line: '10'

Test #29:

score: 0
Accepted
time: 143ms
memory: 5140kb

input:

7039
7238 14240 14254
1729 73885 73886
370 169780 169796
4210 176435 176446
8366 150564 150591
2047 144383 144413
276 78082 78085
3332 42554 42559
7475 109952 109977
7953 54692 54704
5755 137074 137078
655 118659 118678
5599 164677 164695
5120 108320 108339
7153 69777 69785
3477 140570 140575
5683 1...

output:

533

result:

ok single line: '533'

Test #30:

score: 0
Accepted
time: 110ms
memory: 5156kb

input:

7000
47977 1594651 1594674
9112 1465963 1465965
14159 16874 16889
52043 268403 268409
30513 207452 207510
81081 1612077 1612108
43945 824133 824135
67210 1810662 1810665
89250 779493 779508
80219 1583430 1583432
73840 815172 815181
31308 809656 809658
5597 453678 453679
47052 506220 506265
15370 139...

output:

519

result:

ok single line: '519'

Test #31:

score: 0
Accepted
time: 76ms
memory: 5040kb

input:

4990
33 906536 906598
49 199609 199655
6 637460 637484
42 403287 403289
14 910568 910586
18 461086 461093
22 348857 348868
34 971304 971337
34 503035 503043
5 686981 687009
26 766358 766363
20 9653 9678
38 901440 901443
0 123874 123908
29 598689 598700
40 646955 646972
26 625798 625837
19 328514 328...

output:

5384

result:

ok single line: '5384'

Test #32:

score: 0
Accepted
time: 77ms
memory: 5184kb

input:

3996
0 478502 478543
68 833447 833470
29 380263 380267
12 842650 842656
48 196908 196934
97 625237 625288
13 942360 942364
48 626566 626573
30 301321 301347
54 867539 867546
27 672648 672651
86 32746 32810
54 739085 739097
49 663411 663417
87 852149 852177
65 472697 472701
35 783171 783194
24 855456...

output:

4025

result:

ok single line: '4025'

Test #33:

score: 0
Accepted
time: 87ms
memory: 5096kb

input:

4998
163 276611 276635
174 464342 464357
172 510216 510230
173 852703 852759
190 982206 982244
62 948355 948370
36 364432 364445
134 247926 247942
125 937520 937527
132 731153 731155
61 899464 899515
121 694084 694104
193 635708 635711
63 527562 527579
187 137309 137343
134 65643 65661
136 406293 40...

output:

4294

result:

ok single line: '4294'

Test #34:

score: 0
Accepted
time: 47ms
memory: 5092kb

input:

1000
5 8773221 8773328
12 9616217 9616369
1 3512978 3512994
8 777412 777438
16 8099879 8099963
13 848292 848340
25 6232422 6232433
16 9421845 9421993
15 1534595 1534656
21 5886242 5886377
24 4281612 4281617
29 2579912 2580080
5 755067 755081
16 3810581 3810767
5 8389592 8389633
0 4140757 4140886
2 6...

output:

1086

result:

ok single line: '1086'

Test #35:

score: 0
Accepted
time: 62ms
memory: 5260kb

input:

7994
1 5306252 5306264
23 3729154 3729164
29 2215779 2215781
19 9817070 9817076
5 8407392 8407402
26 880619 880627
24 9156886 9156900
6 4252347 4252358
18 5684808 5684814
9 5365917 5365933
20 8354305 8354308
11 1720571 1720572
19 4365673 4365680
29 3466177 3466190
18 7391632 7391641
30 1034361 10343...

output:

8063

result:

ok single line: '8063'

Test #36:

score: 0
Accepted
time: 63ms
memory: 5132kb

input:

7000
19 992324731 992324732
12 475346223 475346232
7 147985780 147985785
19 854358107 854358122
23 434699881 434699900
0 727201236 727201242
19 834577770 834577774
21 927146337 927146345
23 972149156 972149165
19 295507514 295507547
0 503422064 503422080
22 680004833 680004834
8 456042998 456043026
...

output:

7000

result:

ok single line: '7000'

Test #37:

score: 0
Accepted
time: 134ms
memory: 6940kb

input:

100000
99696 0 1
62498 0 1
65368 0 1
38766 0 1
49003 0 1
41713 0 1
25239 0 1
40928 0 1
74270 0 1
97962 0 1
88204 0 1
44237 0 1
73946 0 1
88037 0 1
34452 0 1
94957 0 1
48074 0 1
26198 0 1
66548 0 1
43886 0 1
35817 0 1
48582 0 1
77452 0 1
8017 0 1
7435 0 1
18979 0 1
53884 0 1
59266 0 1
27906 0 1
86680...

output:

1

result:

ok single line: '1'

Test #38:

score: 0
Accepted
time: 118ms
memory: 6956kb

input:

100000
11517 11517 11518
19267 19267 19268
80422 80422 80423
3981 3981 3982
4211 4211 4212
40429 40429 40430
73311 73311 73312
38249 38249 38250
47937 47937 47938
8265 8265 8266
4848 4848 4849
44682 44682 44683
1933 1933 1934
20510 20510 20511
70273 70273 70274
21967 21967 21968
42080 42080 42081
61...

output:

100000

result:

ok single line: '100000'

Test #39:

score: 0
Accepted
time: 119ms
memory: 6932kb

input:

100000
999958698 41302 41303
999912112 87888 87889
999933055 66945 66946
999916605 83395 83396
999950042 49958 49959
999933426 66574 66575
999976047 23953 23954
999937970 62030 62031
999958150 41850 41851
999962409 37591 37592
999915138 84862 84863
999947207 52793 52794
999945361 54639 54640
9999935...

output:

100000

result:

ok single line: '100000'

Test #40:

score: 0
Accepted
time: 136ms
memory: 6960kb

input:

100000
777 116934 116935
777 281964 281965
777 93888 93889
777 482562 482563
777 158994 158995
777 15438 15439
777 234798 234799
777 511950 511951
777 346806 346807
777 472608 472609
777 92040 92041
777 386658 386659
777 373686 373687
777 475440 475441
777 531576 531577
777 42168 42169
777 240108 24...

output:

100000

result:

ok single line: '100000'

Test #41:

score: 0
Accepted
time: 98ms
memory: 5452kb

input:

30000
18071 0 3
21491 0 3
28071 0 3
11190 0 3
1248 0 3
5911 0 3
17920 0 3
5972 0 3
27727 0 3
12268 0 3
20906 0 3
26759 0 3
21597 0 3
21268 0 3
20650 0 3
12778 0 3
11423 0 3
13558 0 3
6188 0 3
2970 0 3
23860 0 3
24685 0 3
15427 0 3
20805 0 3
11351 0 3
26390 0 3
14192 0 3
27578 0 3
13398 0 3
29889 0 3...

output:

3

result:

ok single line: '3'

Test #42:

score: 0
Accepted
time: 104ms
memory: 5560kb

input:

40000
20556 20556 20558
24315 24315 24317
7910 7910 7912
29143 29143 29145
18946 18946 18948
17428 17428 17430
28212 28212 28214
2040 2040 2042
18089 18089 18091
8440 8440 8442
1834 1834 1836
7238 7238 7240
29375 29375 29377
17480 17480 17482
17659 17659 17661
20214 20214 20216
19858 19858 19860
101...

output:

40000

result:

ok single line: '40000'

Test #43:

score: 0
Accepted
time: 128ms
memory: 5448kb

input:

30000
999985093 14907 14910
999996437 3563 3566
999986192 13808 13811
999999985 15 18
999985235 14765 14768
999985538 14462 14465
999984875 15125 15128
999983686 16314 16317
999998114 1886 1889
999996749 3251 3254
999995100 4900 4903
999995733 4267 4270
999992126 7874 7877
999999090 910 913
99999672...

output:

30002

result:

ok single line: '30002'

Test #44:

score: 0
Accepted
time: 84ms
memory: 5552kb

input:

40000
777 155008 155010
777 19663 19665
777 73150 73152
777 181293 181295
777 182721 182723
777 63189 63191
777 272545 272547
777 112889 112891
777 76209 76211
777 184835 184837
777 246239 246241
777 238392 238394
777 155043 155045
777 86751 86753
777 32935 32937
777 128905 128907
777 42287 42289
77...

output:

40000

result:

ok single line: '40000'

Test #45:

score: 0
Accepted
time: 103ms
memory: 5204kb

input:

10000
9885 0 10
6477 0 10
1001 0 10
7724 0 10
5150 0 10
4614 0 10
275 0 10
650 0 10
3395 0 10
7196 0 10
1516 0 10
2550 0 10
1398 0 10
3668 0 10
1029 0 10
7295 0 10
7480 0 10
7753 0 10
6400 0 10
3861 0 10
9213 0 10
3090 0 10
4999 0 10
6891 0 10
5660 0 10
7922 0 10
6604 0 10
2558 0 10
3328 0 10
8179 0...

output:

10

result:

ok single line: '10'

Test #46:

score: 0
Accepted
time: 161ms
memory: 5120kb

input:

9000
2522 2522 2533
2980 2980 2991
8186 8186 8197
4657 4657 4668
5319 5319 5330
4578 4578 4589
3384 3384 3395
1061 1061 1072
4328 4328 4339
5744 5744 5755
1708 1708 1719
7828 7828 7839
1457 1457 1468
2342 2342 2353
6174 6174 6185
504 504 515
3032 3032 3043
1682 1682 1693
3935 3935 3946
7066 7066 707...

output:

9010

result:

ok single line: '9010'

Test #47:

score: 0
Accepted
time: 165ms
memory: 5108kb

input:

9000
999994453 5547 5558
999999448 552 563
999991699 8301 8312
999993651 6349 6360
999996073 3927 3938
999999512 488 499
999999144 856 867
999994045 5955 5966
999999948 52 63
999993066 6934 6945
999995849 4151 4162
999996702 3298 3309
999998839 1161 1172
999997527 2473 2484
999991626 8374 8385
99999...

output:

9010

result:

ok single line: '9010'

Test #48:

score: 0
Accepted
time: 67ms
memory: 5172kb

input:

9000
777 85296 85307
777 71120 71131
777 60016 60027
777 133920 133931
777 136688 136699
777 46416 46427
777 99104 99115
777 135552 135563
777 114720 114731
777 73216 73227
777 69296 69307
777 128272 128283
777 43760 43771
777 3552 3563
777 113824 113835
777 18496 18507
777 60352 60363
777 59792 598...

output:

9000

result:

ok single line: '9000'

Test #49:

score: 0
Accepted
time: 128ms
memory: 4956kb

input:

500
453 0 200
95 0 200
260 0 200
140 0 200
412 0 200
9 0 200
314 0 200
248 0 200
243 0 200
455 0 200
398 0 200
138 0 200
356 0 200
168 0 200
487 0 200
146 0 200
104 0 200
445 0 200
479 0 200
41 0 200
4 0 200
159 0 200
35 0 200
280 0 200
158 0 200
184 0 200
223 0 200
88 0 200
251 0 200
386 0 200
238 ...

output:

200

result:

ok single line: '200'

Test #50:

score: 0
Accepted
time: 135ms
memory: 5008kb

input:

500
112 112 312
159 159 359
313 313 513
149 149 349
189 189 389
49 49 249
426 426 626
275 275 475
187 187 387
147 147 347
139 139 339
400 400 600
34 34 234
312 312 512
498 498 698
347 347 547
136 136 336
372 372 572
94 94 294
411 411 611
478 478 678
82 82 282
265 265 465
17 17 217
184 184 384
6 6 20...

output:

698

result:

ok single line: '698'

Test #51:

score: 0
Accepted
time: 132ms
memory: 5124kb

input:

500
999999827 173 373
999999512 488 688
999999534 466 666
999999730 270 470
999999975 25 225
999999605 395 595
999999700 300 500
999999723 277 477
999999526 474 674
999999675 325 525
999999826 174 374
999999588 412 612
999999636 364 564
999999941 59 259
999999969 31 231
999999866 134 334
999999669 3...

output:

698

result:

ok single line: '698'

Test #52:

score: 0
Accepted
time: 48ms
memory: 5132kb

input:

500
777 205 405
777 49200 49400
777 2050 2250
777 48175 48375
777 94915 95115
777 92250 92450
777 18655 18855
777 92045 92245
777 22345 22545
777 68265 68465
777 37515 37715
777 21320 21520
777 13325 13525
777 30750 30950
777 49815 50015
777 2870 3070
777 78925 79125
777 46535 46735
777 6355 6555
77...

output:

500

result:

ok single line: '500'

Test #53:

score: 0
Accepted
time: 141ms
memory: 4976kb

input:

50
29 0 2000
24 0 2000
46 0 2000
21 0 2000
14 0 2000
7 0 2000
22 0 2000
49 0 2000
42 0 2000
26 0 2000
32 0 2000
33 0 2000
13 0 2000
34 0 2000
4 0 2000
25 0 2000
45 0 2000
19 0 2000
18 0 2000
8 0 2000
23 0 2000
47 0 2000
38 0 2000
41 0 2000
3 0 2000
2 0 2000
48 0 2000
20 0 2000
39 0 2000
5 0 2000
40 ...

output:

2000

result:

ok single line: '2000'

Test #54:

score: 0
Accepted
time: 142ms
memory: 5008kb

input:

50
45 45 2045
23 23 2023
39 39 2039
9 9 2009
0 0 2000
27 27 2027
29 29 2029
7 7 2007
12 12 2012
38 38 2038
33 33 2033
42 42 2042
3 3 2003
2 2 2002
31 31 2031
1 1 2001
28 28 2028
36 36 2036
49 49 2049
47 47 2047
40 40 2040
18 18 2018
41 41 2041
25 25 2025
44 44 2044
30 30 2030
17 17 2017
35 35 2035
3...

output:

2048

result:

ok single line: '2048'

Test #55:

score: 0
Accepted
time: 138ms
memory: 4944kb

input:

50
999999954 46 2046
999999958 42 2042
999999967 33 2033
999999979 21 2021
999999953 47 2047
999999976 24 2024
999999965 35 2035
999999994 6 2006
999999963 37 2037
999999995 5 2005
999999991 9 2009
999999961 39 2039
999999985 15 2015
999999977 23 2023
999999993 7 2007
999999955 45 2045
999999984 16 ...

output:

2048

result:

ok single line: '2048'

Test #56:

score: 0
Accepted
time: 44ms
memory: 4948kb

input:

50
777 12030 14030
777 80200 82200
777 44110 46110
777 14035 16035
777 10025 12025
777 58145 60145
777 42105 44105
777 96240 98240
777 64160 66160
777 84210 86210
777 28070 30070
777 38095 40095
777 6015 8015
777 50125 52125
777 8020 10020
777 94235 96235
777 30075 32075
777 36090 38090
777 92230 94...

output:

50

result:

ok single line: '50'