QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#28115#3584. Daily TurnoversRetucl#WA 266ms103820kbC++142.9kb2022-04-12 08:34:042022-04-29 08:57:18

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-04-29 08:57:18]
  • Judged
  • Verdict: WA
  • Time: 266ms
  • Memory: 103820kb
  • [2022-04-12 08:34:04]
  • Submitted

answer

#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fir first
#define sec second

#define modPrepare() \
void Add(int &x,int y){(x+=y)>=Mod?x-=Mod:x;}\
void Del(int &x,int y){(x-=y)<0?x+=Mod:x;}\
int Pow(int a,int b){\
	int res=1;\
	while(b){\
		if(b&1) res=1ll*res*a%Mod;\
		a=1ll*a*a%Mod,b>>=1;\
	}\
	return res;\
}

#define facPrepare(_) \
const int len=_;\
int Fac[len+10],Iac[len+10]; \
void facInit(){\
	Fac[0]=Iac[0]=1;\
	for(int i=1;i<=len;++i) Fac[i]=1ll*Fac[i-1]*i%Mod;\
	Iac[len]=Pow(Fac[len],Mod-2);\
	for(int i=len-1;i;--i) Iac[i]=1ll*Iac[i+1]*(i+1)%Mod;\
}\
int Binom(int x,int y){return x<y?0:1ll*Fac[x]*Iac[y]%Mod*Iac[x-y]%Mod;}

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;

void read(int& x){
    static char c;int f=0;
    while(!isdigit(c=getchar()))
        if(c=='-') f=1;
    x=c^48;
    while(isdigit(c=getchar())) x=(x*10)+(c^48);
    if(f) x=-x;
}
void read(ll& x){
    static char c;int f=0;
    while(!isdigit(c=getchar()))
    	if(c=='-') f=1;
    x=c^48;
    while(isdigit(c=getchar())) x=(x*10)+(c^48);
    if(f) x=-x;
}
void read(uint& x){
    static char c;
    while(!isdigit(c=getchar()));x=c^48;
    while(isdigit(c=getchar())) x=(x*10)+(c^48);
}
void read(ull& x){
    static char c;
    while(!isdigit(c=getchar()));x=c^48;
    while(isdigit(c=getchar())) x=(x*10)+(c^48);
}
void chkmax(int& x,int y){if(y>x)x=y;}
void chkmin(int& x,int y){if(y<x)x=y;}
void chkmax(ll& x,ll y){if(y>x)x=y;}
void chkmin(ll& x,ll y){if(y<x)x=y;}
void chkmax(uint& x,uint y){if(y>x)x=y;}
void chkmin(uint& x,uint y){if(y<x)x=y;}
void chkmax(ull& x,ull y){if(y>x)x=y;}
void chkmin(ull& x,ull y){if(y<x)x=y;}

const int N=5e5+10;

int X,n;
ll A[N],S[N];

int sta[N],R[N],D[N],top;

int _lg[N];
ll st[N][21];
void Init(){
	memset(st,-0x3f,sizeof st);
	for(int i=2;i<=n;++i) _lg[i]=_lg[i>>1]+1;
	for(int i=1;i<=n;++i) st[i][0]=S[i];
	for(int B=1;B<=20;++B)
		for(int i=1;i+(1<<B)-1<=n;++i)
			st[i][B]=min(st[i][B-1],st[i+(1<<B-1)][B-1]);
}
ll Ask(int l,int r){
	int k=_lg[r-l+1];
	return min(st[l][k],st[r-(1<<k)+1][k]);
}

void Work(){
	read(X),read(n);
	for(int i=1;i<=n;++i) read(A[i]);
	for(int i=1;i<=n;++i) S[i]=S[i-1]+A[i];
	Init();
	sta[++top]=0;
	for(int i=0;i<=n;++i) R[i]=n+1;
	for(int i=1;i<=n;++i){
		while(top&&S[i]<S[sta[top]]) R[sta[top--]]=i;
		sta[++top]=i;
	}
	ll tmp=0,Ans=0;
	for(int i=0;i<n;++i) tmp+=R[i]-i-1;
	for(int i=0;i<n;++i){
		int l=i+1,r=n,mid,res=n+1;
		while(l<=r){
			mid=(l+r)>>1;
			if(Ask(i+1,mid)+X<S[i]) res=mid,r=mid-1;
			else l=mid+1;
		}
		D[i]=res-R[i];
	}
	priority_queue<pii,vector<pii>,greater<pii>> Q;
	for(int p=1;p<=n;++p){
		Q.push({R[p-1],p-1}),tmp+=D[p-1];
		while(Q.size()){
			auto o=Q.top();
			if(o.fir>=p) break;
			Q.pop(),tmp-=D[o.sec];
		}
		chkmax(Ans,tmp);
	}
	printf("%lld\n",Ans);
}

int main(){Work();}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 8ms
memory: 89884kb

input:

1 6
1 1 -2 1 3 -5

output:

13

result:

ok single line: '13'

Test #2:

score: 0
Accepted
time: 22ms
memory: 90400kb

input:

88 48799
-29 51 -94 23 100 -44 -49 -71 99 39 -42 45 65 -28 78 -72 -28 -34 53 -88 78 -46 27 73 56 -13 72 66 11 -55 -1 -44 -24 -28 18 79 31 100 -53 -88 41 70 8 85 -6 78 -50 -43 57 -7 -32 -96 -69 58 -58 21 65 -98 19 57 25 35 8 -88 -41 62 -44 72 -23 61 53 -23 -45 -35 -7 47 47 40 66 -10 23 -24 -97 -92 20...

output:

11252741

result:

ok single line: '11252741'

Test #3:

score: 0
Accepted
time: 88ms
memory: 96132kb

input:

-692982840 189297
-319880894 165778290 -804292010 -905153678 -141539645 744104341 -592456751 45240119 -792186907 142335460 614999455 -214843257 -836389022 288401576 378694316 849003582 -384735495 628858044 454261201 449558021 945257935 -818780631 -935871293 -248039091 -908247714 -810028298 -18310377...

output:

29236338

result:

ok single line: '29236338'

Test #4:

score: 0
Accepted
time: 80ms
memory: 96348kb

input:

-847081208 201777
-362342902 950538897 170409400 354851727 724412466 -555164993 431472288 -402948810 511594694 651665414 200017472 306904258 451470872 367316021 217115121 740714342 -492867023 905716166 -769017028 -478302606 -258209227 566281439 809251360 -356674022 -525604385 -199460024 -413953914 -...

output:

99422567

result:

ok single line: '99422567'

Test #5:

score: 0
Accepted
time: 254ms
memory: 99504kb

input:

-46689617 468654
-873608239 844369497 -586342166 87244063 487246974 -30920724 130461290 872852725 713049323 -897961405 -224206400 -120538066 -384818301 -813867084 714125604 535003985 842837347 685415357 816352739 -81481393 -669897434 -496368655 -837871108 -263338207 867165429 479080381 -258478354 -4...

output:

325205671

result:

ok single line: '325205671'

Test #6:

score: 0
Accepted
time: 88ms
memory: 95872kb

input:

-105024314 163130
399674258 189278497 -570171557 573121394 437349803 713633701 393808694 -453852681 -787237756 -767295024 848259499 473139355 -402247363 715760936 444643380 710777004 -521668817 528953523 944981793 -736461629 169934543 -987916260 -355504488 618029850 973830329 999300082 508244142 566...

output:

43132865

result:

ok single line: '43132865'

Test #7:

score: 0
Accepted
time: 116ms
memory: 96840kb

input:

-669308097 250859
-30957923 -815495614 993038014 -886997997 206435672 -296683788 -501369159 -254681816 650312002 -832243057 -203302371 -810582727 486472638 588596060 296106971 352203572 -740414374 166062741 -182542463 -576531936 881035288 522504094 -558279511 -112954183 -640498286 -236782124 5590322...

output:

43429561

result:

ok single line: '43429561'

Test #8:

score: 0
Accepted
time: 212ms
memory: 98672kb

input:

-415865574 373402
537337034 -775449577 -986685122 -415417439 -427343772 882493829 -187997993 990453306 213987186 769635852 -730612457 -636502154 166201993 -349188123 -24615725 459127269 615688966 -733987113 -317247258 -334534978 253617848 492071220 470724675 -573696637 -113167646 227055072 -46147828...

output:

209225802

result:

ok single line: '209225802'

Test #9:

score: 0
Accepted
time: 173ms
memory: 97708kb

input:

-984904548 332557
848322713 -583914591 756630309 779011645 -425502784 699827041 64275178 -880171172 -534031531 -911460107 612260787 974173341 714983930 -227425470 -631004899 495075429 985906938 -408858677 536841560 917582465 -600114146 -754974084 718709902 834494811 227599319 53754380 -840427573 805...

output:

55145126

result:

ok single line: '55145126'

Test #10:

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

input:

-874480785 64520
-568141258 -492904441 -702443562 -739990261 925188732 831347318 123434742 -473296046 -376808574 776449962 149742619 -333724977 -585465734 355455841 -639240780 661131574 -220739797 101459511 749085594 -316085814 679136591 512664698 -39847220 403513372 17697173 189427865 -948945991 -1...

output:

12828522

result:

ok single line: '12828522'

Test #11:

score: 0
Accepted
time: 51ms
memory: 93160kb

input:

-844462533 113704
951387629 -789228011 -67659437 229227600 858431468 -11859968 133998376 -980867902 -809257080 -156771729 570219542 230262976 606047982 505316601 -207267564 55124942 497651928 75450099 -391929961 -866579009 -766802245 -775940721 827975501 -736069973 -341642708 626585175 -482032827 -4...

output:

36648253

result:

ok single line: '36648253'

Test #12:

score: 0
Accepted
time: 151ms
memory: 97328kb

input:

-639094816 282990
487052011 -688641544 630504506 352924261 -418550232 727183537 -962676115 81914054 650345945 -152960350 -114364795 579870981 687372350 -358401273 -245857985 -691453144 164830123 -430830549 -790051168 -656478422 139768265 -255714057 233580342 690423501 -551976520 -534428518 -82152138...

output:

53730890

result:

ok single line: '53730890'

Test #13:

score: 0
Accepted
time: 80ms
memory: 96288kb

input:

1 205998
63 -55 5 81 -60 -24 -74 32 -57 0 3 98 32 -12 -93 39 36 -60 -14 -53 -90 -48 -50 2 -60 26 0 92 3 -80 83 72 9 -53 8 -88 84 56 -22 -44 -8 -33 94 49 10 -3 -68 84 -58 70 98 -10 34 5 13 48 60 68 25 -79 -2 -15 71 23 79 82 99 -39 8 51 -8 -49 -86 -43 -57 9 47 -28 55 85 18 -62 -46 13 42 30 -45 52 -99 ...

output:

29514987

result:

ok single line: '29514987'

Test #14:

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

input:

-860057994 338805
-121717271 289169652 100623933 632828260 639632866 -968616101 -845994380 485160188 -637608241 387990137 857691217 439507774 44333041 -729956628 -967429360 400748320 -693822734 88912002 304373898 -83105861 766149072 -823501469 935740502 996141753 740927 646458829 690788363 521631053...

output:

163968521

result:

ok single line: '163968521'

Test #15:

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

input:

-438024235 20846
883920232 57654665 324722295 -624176905 -655958558 495671430 443793401 746502299 -938444280 -357527306 709870564 836501010 38946484 804861354 -216112611 210972054 957336935 577585608 -335640215 -34239864 -799442741 116452497 479654663 583696122 101830896 339665244 -923333155 8098343...

output:

1906850

result:

ok single line: '1906850'

Test #16:

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

input:

-984823050 86364
-576401231 136397105 -449039691 -730522380 -970873197 -875545444 638806254 -153729061 960295318 700602544 -362743648 410720329 -177150127 759428603 -1227119 406746096 770040418 -316244723 -154913818 185390022 -76845491 -199990369 -92323329 -987024726 -788599140 -554632205 -221098497...

output:

12460624

result:

ok single line: '12460624'

Test #17:

score: 0
Accepted
time: 157ms
memory: 97752kb

input:

-642386998 326758
-667998316 532875866 650367814 664181383 609784634 175396744 504496384 528275131 903218059 662163322 -976061604 -37165541 538278415 98030378 580260172 515255468 -732843779 -475901612 228445267 -14662672 -927246352 -289452128 -273207171 -999881039 -478170467 351183113 138869608 4201...

output:

56946960

result:

ok single line: '56946960'

Test #18:

score: 0
Accepted
time: 69ms
memory: 91832kb

input:

-345137235 155576
-260615762 -806964557 -304134533 644948627 -264683691 190569731 -635967569 -796187555 -620846071 797136062 263534689 984294000 -643012106 606621092 93997008 -729959850 -771112748 113144210 -220477488 -944789196 504239760 182809731 -418737391 -659768483 379698641 647065820 68464820 ...

output:

37917384

result:

ok single line: '37917384'

Test #19:

score: 0
Accepted
time: 17ms
memory: 90356kb

input:

-329648984 38916
-493771958 -74657704 -336479320 -718294330 -416303312 275179952 143304929 308213353 -501112885 -745239790 -120525641 160701254 340911388 284209528 -286894197 -675549053 744090318 -155118674 111824372 -664936194 381672413 -140296064 -685466037 -569206214 -273993849 -543862846 -624164...

output:

33406

result:

ok single line: '33406'

Test #20:

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

input:

-646248790 330204
-707692191 619122474 681123489 -478584900 377895747 255010083 -281909827 -594240804 -602296129 -113540068 836305497 -972607414 612412518 -114858261 -796524203 -163122186 -219890028 418621736 -501927094 -877594077 470892163 -425025843 757811163 -33291618 -795538751 -842411265 -20187...

output:

279465

result:

ok single line: '279465'

Test #21:

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

input:

-28126747 268155
299095251 -732879679 -775628231 -430061266 -618129103 -573687885 -715864837 289717221 149110084 -64054250 -536243842 -255336671 -951487943 -557220502 -522853211 562250787 -968372503 -908617511 592235025 -866880459 975436327 -185873520 623427983 -127463203 -748696203 -99467674 -50415...

output:

226567

result:

ok single line: '226567'

Test #22:

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

input:

-705229182 31714
-531155619 -773715209 454337296 -780860135 -981746203 627077753 -744825216 -789693806 -917497601 776980223 -854288473 188986450 -876502100 461182330 761331637 602957049 -776501719 -444938349 -213034758 133659860 -300686839 -230277889 -69393738 103470536 -382195907 -912609709 9786864...

output:

26374

result:

ok single line: '26374'

Test #23:

score: 0
Accepted
time: 160ms
memory: 98068kb

input:

-701873722 346965
-285561574 -913868072 -438680739 -642478208 -635510569 -418420148 -490603381 -227730031 127188597 337281552 -838723115 130135253 115810057 263863418 -763864366 -386429932 -156749189 -868827048 -882054639 -974024169 -528194168 219380847 -794616295 -999526687 -821776889 -614744 -8193...

output:

290370

result:

ok single line: '290370'

Test #24:

score: 0
Accepted
time: 22ms
memory: 92512kb

input:

61 47299
-31 -12 93 95 31 63 -4 -74 51 -39 56 -71 -88 86 19 -25 -47 -83 -42 44 -98 81 53 -83 32 -39 -47 86 10 90 -64 -86 34 -78 79 -20 -60 57 -69 40 -8 -14 -87 90 52 -25 17 84 -82 -95 -63 24 -41 9 79 -78 -86 -73 -100 6 -75 45 -93 -26 -26 -41 6 -47 74 -16 95 -83 78 -52 56 -86 -63 -58 -95 57 -69 29 87...

output:

5342957

result:

ok single line: '5342957'

Test #25:

score: 0
Accepted
time: 82ms
memory: 91852kb

input:

-416215727 179399
-334814367 -584154660 230168739 -143379055 -418882822 722760193 493677894 -70338017 -531171850 126086177 -130443997 738296126 832569559 -861113421 -255017398 412571419 -356230882 -832896968 -218524363 -593299568 -66279966 -646898403 -215724853 -176889560 -610745381 -447982517 -2837...

output:

151839

result:

ok single line: '151839'

Test #26:

score: 0
Accepted
time: 49ms
memory: 93512kb

input:

-721117726 145984
-371962404 -913036881 513265819 722849544 -726408598 -540164553 929387198 166856627 -353556945 -895550340 -18616251 788980463 -571004323 -298962520 -737714255 -455939963 -723485309 -653520030 -149166288 -58499950 -992691819 -326542244 -334932897 -740352110 -13281491 -882696356 6779...

output:

120214

result:

ok single line: '120214'

Test #27:

score: 0
Accepted
time: 231ms
memory: 99728kb

input:

-223945242 482162
662120088 333852753 -297340698 -728192196 659246833 80792878 431681037 495711925 -347540508 -167261077 -565727437 -495854718 -117805263 -493578357 -612753911 -307990010 -338456684 -421052983 -385176499 -624076176 -583009093 240794284 218303918 610040480 600505048 -440739215 -875659...

output:

403078

result:

ok single line: '403078'

Test #28:

score: 0
Accepted
time: 81ms
memory: 94452kb

input:

-369349426 212793
586831094 -464703126 -174327429 -240678370 -439913404 -528574185 -262666411 -107428626 -273070717 -594856773 793051113 -814057455 614350220 -239514960 -431300609 -423024612 -93750438 254742576 -491951660 -857092321 -247070933 -130485801 -138981611 -236485544 -66829486 -738864690 -1...

output:

175962

result:

ok single line: '175962'

Test #29:

score: 0
Accepted
time: 190ms
memory: 98468kb

input:

-46394335 393087
-487869730 -124563028 -629316691 -416737604 280006631 -820215006 -937506102 -273233821 -470603680 -795442712 652103395 -955195569 -755051399 -573298418 -135729195 -150347216 714037674 -182756776 -532374945 -158886617 248840557 127564501 -586221483 -884100791 -450513842 -248460332 -5...

output:

329983

result:

ok single line: '329983'

Test #30:

score: 0
Accepted
time: 102ms
memory: 97116kb

input:

-883947246 275597
-120319082 105714474 158690420 -931859133 -367640233 -816303755 -312483518 -512535254 -851435755 17458100 -195588602 -131213107 442571282 -770077323 348192832 -959197371 -716253216 470646603 -694446377 -839797329 -944159675 -129842005 -932898782 -854126570 -275203825 -452225244 -30...

output:

57842

result:

ok single line: '57842'

Test #31:

score: 0
Accepted
time: 203ms
memory: 99104kb

input:

-373643387 447525
-205100430 -499699438 -536945284 -214283803 -628164829 -260092833 -148253859 -195381889 -299083639 -76119465 -817282553 -351776353 -954420784 -57979679 -524329282 -598004739 -288871638 -410365045 440070189 -967360969 -894327609 -5953964 -354332610 -502018245 -861136718 -393473005 -...

output:

95895

result:

ok single line: '95895'

Test #32:

score: 0
Accepted
time: 226ms
memory: 99856kb

input:

-247252579 469452
-230059721 -741910418 -42898416 -290871756 -843294412 -104280727 -476053704 -721522759 -9669542 -297531465 -826074474 -359636276 -38360833 -9289711 -464064388 -347637943 -696369861 -570507743 -958981965 -971972205 -384965738 -750734557 -676279641 -631586977 -648337890 -913239775 -5...

output:

100401

result:

ok single line: '100401'

Test #33:

score: 0
Accepted
time: 41ms
memory: 92684kb

input:

-161858628 67919
-364563207 -911029944 -241828995 -424354712 -52798369 -652868550 -663784423 -135554003 496903000 846022878 -19281151 -677005520 -224013334 -844178035 -714044364 -952468756 -24312105 -699989438 -994478465 -621803223 -110643344 795002087 -756820062 -35473714 -972810069 -197274889 -983...

output:

15006

result:

ok single line: '15006'

Test #34:

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

input:

-564973315 196869
-229500619 -36995738 -117302309 -541284899 687156283 -330743012 -745254697 -687082549 -121732815 -785373058 14675384 -182385082 -240808225 802537647 -698273407 -566687054 -12735320 -999012235 -18985138 -191009215 -71090000 -774464270 -366683282 -211361410 -563791225 -113694741 -731...

output:

41207

result:

ok single line: '41207'

Test #35:

score: 0
Accepted
time: 70ms
memory: 97684kb

input:

850544363 178453
970388759 669001200 472677728 407679109 394721654 396014693 472229904 950064319 604016799 312470667 581487572 286403436 152802913 111043420 995998811 969016896 495647559 694891360 89729659 197002822 902139156 962489258 962824279 434882312 325042810 454834188 634581291 663589480 1118...

output:

15922825831

result:

ok single line: '15922825831'

Test #36:

score: 0
Accepted
time: 213ms
memory: 100572kb

input:

-808797225 475754
-944961703 -955925494 -891844126 -810107428 -209207011 -804831715 -225273233 -415310674 -207769417 -201192807 -281793806 -187938655 -957282393 -678367092 -152687608 -361667346 -231431337 -435975041 -19038351 -147514835 -753044362 -220360614 -58758965 -657902278 -792177434 -70108134...

output:

0

result:

ok single line: '0'

Test #37:

score: 0
Accepted
time: 106ms
memory: 97024kb

input:

-668620308 258251
-720678453 -354991238 -514306414 -895372884 -823973496 -263208443 -588208739 -909578569 -995224131 -684956666 -296546675 -619763188 -566532532 -714532778 -338942961 -435908159 -717932148 -853749033 -932851448 -437899207 -562603773 -84286499 -464771335 -253060755 -568751105 -7135672...

output:

0

result:

ok single line: '0'

Test #38:

score: 0
Accepted
time: 93ms
memory: 96468kb

input:

-882901989 218008
-711051097 -904334412 -682837210 -973504743 -832613745 -596320271 -594212900 -491854787 -65445225 -382039213 -984243485 -550768045 -172173401 -409098384 -417680721 -707158466 -889989585 -752035626 -396290142 -75777798 -922482023 -306746332 -220777264 -356885772 -3394474 -642195643 ...

output:

0

result:

ok single line: '0'

Test #39:

score: 0
Accepted
time: 203ms
memory: 99464kb

input:

-206784327 404816
-422308839 -366257066 -860714032 -711232445 -552272480 -57142591 -951032687 -842869902 -379943923 -547462923 -295137759 -948929499 -663766846 -889674832 -111241287 -395951579 -907599467 -686193733 -805456083 -271543481 -114499039 -432749174 -80745028 -252291581 -630651318 -73657941...

output:

0

result:

ok single line: '0'

Test #40:

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

input:

-883599705 179922
-172049793 -369565590 -561315172 -756077649 -119964781 -310167324 -190629634 -809389234 -890857758 -317631529 -182764583 -64731724 -694482019 -77996022 -736115793 -361551054 -82107213 -762840850 -788390756 -626344444 -377490475 -205699669 -13898677 -897022629 -904797607 -784295088 ...

output:

0

result:

ok single line: '0'

Test #41:

score: 0
Accepted
time: 182ms
memory: 103820kb

input:

592590915 443277
182534460 887778720 948015379 546264278 2563281 353309160 455578797 2443909 228227545 641587315 751900707 901747001 604885340 250794126 408255490 926662713 578319243 908230004 726145132 449638420 33764928 634809575 268834718 346691204 323327186 892856146 456979666 234782594 40825671...

output:

98247471003

result:

ok single line: '98247471003'

Test #42:

score: 0
Accepted
time: 169ms
memory: 102896kb

input:

339702931 386724
31025318 226412080 408334541 594773309 68233888 930431257 914378295 689726391 11623292 524626273 960339000 169079751 15174432 432078537 611555700 530518636 528935227 385751066 145819526 656337701 732999456 976117429 433019906 582411261 409052120 645904808 467753820 861210454 8792459...

output:

74777919450

result:

ok single line: '74777919450'

Test #43:

score: 0
Accepted
time: 150ms
memory: 99156kb

input:

329016661 285231
463122455 643900940 534305516 865949611 -42558899 307604894 -145560211 994028603 -150177430 955553598 829215478 965415496 315493096 781681504 903857631 336442537 394928162 430425632 -377723349 -91912889 54833987 -327810334 960222443 702142311 764873594 63234525 -571940646 607192502 ...

output:

22231231788

result:

ok single line: '22231231788'

Test #44:

score: 0
Accepted
time: 266ms
memory: 102360kb

input:

795353801 475091
343166151 722868549 637087852 225984487 327487220 551949854 -835953292 738317487 617718726 466672873 345099510 652936728 598206903 634700403 261579015 -964052855 -408861666 590143835 667554970 170913369 -935853581 332346497 772409760 830283601 934922839 435824401 674220988 -95503454...

output:

61208386687

result:

ok single line: '61208386687'

Test #45:

score: 0
Accepted
time: 113ms
memory: 98512kb

input:

40829836 247763
777348594 -584307244 -220604669 995531628 453490723 838403755 838052880 439748834 619149806 825436712 911198626 883377757 465123850 429907357 -488741298 857357565 582343358 601715468 -16069147 190272665 -65333100 656187584 -575948925 976348930 828595174 317005262 184526623 479654310 ...

output:

16632258851

result:

ok single line: '16632258851'

Test #46:

score: 0
Accepted
time: 232ms
memory: 101712kb

input:

28288719 433398
-988652328 578626571 337177965 157330744 553075785 -709557327 266152992 587955798 364820463 -817107678 -725256822 760876359 207695423 -720483772 -568219380 764620805 -488402980 183630074 560156072 -20558023 -635376973 772215463 962428515 922572060 -561051919 52060227 662839560 -98664...

output:

50980345861

result:

ok single line: '50980345861'

Test #47:

score: -100
Wrong Answer
time: 11ms
memory: 89820kb

input:

-1 6
1 1 -2 1 3 -5

output:

6

result:

wrong answer 1st lines differ - expected: '9', found: '6'