QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#956384 | #10134. TEST_176 | w9095 | 49 | 475ms | 26084kb | C++23 | 6.3kb | 2025-03-29 19:22:30 | 2025-03-29 19:22:30 |
Judging History
answer
#include<bits/stdc++.h>
#pragma GCC optimize(3)
#pragma comment(linker,"/stack:200000000")
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
#pragma GCC optimize("-fdelete-null-pointer-checks,inline-functions-called-once,-funsafe-loop-optimizations,-fexpensive-optimizations,-foptimize-sibling-calls,-ftree-switch-conversion,-finline-small-functions,inline-small-functions,-frerun-cse-after-loop,-fhoist-adjacent-loads,-findirect-inlining,-freorder-functions,no-stack-protector,-fpartial-inlining,-fsched-interblock,-fcse-follow-jumps,-fcse-skip-blocks,-falign-functions,-fstrict-overflow,-fstrict-aliasing,-fschedule-insns2,-ftree-tail-merge,inline-functions,-fschedule-insns,-freorder-blocks,-fwhole-program,-funroll-loops,-fthread-jumps,-fcrossjumping,-fcaller-saves,-fdevirtualize,-falign-labels,-falign-loops,-falign-jumps,unroll-loops,-fsched-spec,-ffast-math,Ofast,inline,-fgcse,-fgcse-lm,-fipa-sra,-ftree-pre,-ftree-vrp,-fpeephole2",3)
using namespace std;
int n,m,li,ri,ch[200002][2],fa[200002],rev[200002],st[200002],y[200002],top=0,cnt=1,rt=1;
long long ci,a[200002],val[200002],ad[200002],ans[200002];
vector<int>l[200002],r[200002];
vector<long long>c[200002];
inline long long read()
{
long long x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=x*10+ch-48;ch=getchar();}
return x*f;
}
void print(long long x)
{
if(x<0)putchar('-'),x=-x;
if(x>9)print(x/10);
putchar('0'+x%10);
}
bool wh(int x)
{
return ch[fa[x]][1]==x;
}
void pushdown(int x)
{
if(rev[x])
{
if(ch[x][0])rev[ch[x][0]]^=1,val[ch[x][0]]*=-1,ad[ch[x][0]]*=-1,swap(ch[ch[x][0]][0],ch[ch[x][0]][1]);
if(ch[x][1])rev[ch[x][1]]^=1,val[ch[x][1]]*=-1,ad[ch[x][1]]*=-1,swap(ch[ch[x][1]][0],ch[ch[x][1]][1]);
rev[x]=0;
}
if(ch[x][0])val[ch[x][0]]+=ad[x],ad[ch[x][0]]+=ad[x];
if(ch[x][1])val[ch[x][1]]+=ad[x],ad[ch[x][1]]+=ad[x];
ad[x]=0;
}
void rotate(int x)
{
int y=fa[x],z=fa[y],id=wh(x);
ch[z][wh(y)]=x,fa[x]=z;
ch[y][id]=ch[x][id^1],fa[ch[x][id^1]]=y;
ch[x][id^1]=y,fa[y]=x;
}
void pushall(int x)
{
int p=x;
while(p)st[++top]=p,p=fa[p];
while(top>0)pushdown(st[top]),top--;
}
void splay(int &rt,int x)
{
pushall(x);
while(fa[x])
{
long long y=fa[x],z=fa[y];
if(z)
{
if(wh(x)==wh(y))rotate(y);
else rotate(x);
}
rotate(x);
}
rt=x;
}
int create(int &rt,int p,long long k,int id)
{
ch[p][id]=++cnt,val[cnt]=k,fa[cnt]=p,splay(rt,ch[p][id]);
return cnt;
}
int insert(int &rt,long long p)
{
int x=rt;
while(x)
{
pushdown(x);
if(val[x]==p)return x;
else if(p<val[x])
{
if(!ch[x][0])return create(rt,x,p,0);
x=ch[x][0];
}
else
{
if(!ch[x][1])return create(rt,x,p,1);
x=ch[x][1];
}
}
return x;
}
int getmin(int &rt)
{
int x=rt;
while(ch[x][0])pushdown(x),x=ch[x][0];
splay(rt,x);
return x;
}
int split(int &rt,long long k)
{
int x=rt,ap=0,pr=0;
long long ans=1e18;
while(x)
{
pr=x,pushdown(x);
if(k>=val[x])x=ch[x][1];
else if(k<val[x])
{
if(val[x]<=ans)ans=val[x],ap=x;
x=ch[x][0];
}
}
splay(rt,pr);
if(ap==0)
{
int nrt=rt;
rt=0;
return nrt;
}
splay(rt,ap);
int nrt=ch[rt][0];
fa[ch[rt][0]]=0,ch[rt][0]=0;
return nrt;
}
int merge(int &rt1,int &rt2)
{
bool flag=0;
while(rt1&&rt2)
{
if(!flag)
{
int p=getmin(rt1),nrt=0;
splay(rt1,p),nrt=split(rt2,val[p]),fa[nrt]=p,ch[p][0]=nrt;
}
else
{
int p=getmin(rt2),nrt=0;
splay(rt2,p),nrt=split(rt1,val[p]),fa[nrt]=p,ch[p][0]=nrt;
}
flag^=1;
}
return rt1+rt2;
}
int main()
{
val[1]=1e17;
n=read(),m=read();
for(int i=1;i<=n;i++)a[i]=read();
for(int i=1;i<=m;i++)ci=read(),li=read(),ri=read(),l[li].push_back(i),r[ri].push_back(i),c[li].push_back(ci);
for(int i=1;i<=n;i++)
{
for(int j=0;j<(int)l[i].size();j++)y[l[i][j]]=insert(rt,c[i][j]);
int nrt=split(rt,(a[i]-1)>>1);
rev[nrt]^=1,val[nrt]*=-1,ad[nrt]*=-1,swap(ch[nrt][0],ch[nrt][1]),val[nrt]+=a[i],ad[nrt]+=a[i];
rt=merge(rt,nrt);
for(int j=0;j<(int)r[i].size();j++)splay(rt,y[r[i][j]]),ans[r[i][j]]=val[y[r[i][j]]];
}
for(int i=1;i<=m;i++)print(ans[i]),putchar('\n');
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 8
Accepted
Test #1:
score: 8
Accepted
time: 2ms
memory: 11992kb
input:
1000 1000 -612414969997 8335305508102 -8957818322368 -8807848248329 307097452555 3868326134149 2088807947583 1448969769583 5432830544174 6203236674861 6326635163959 36340314641 9527347794701 -5195306769044 -2148977441993 5155627229333 -2896856623367 -3833291531007 -3005294212652 4840716327468 294868...
output:
13408002513578 15682171649761 5885687413844 6256756620026 11252719148519 8798673000951 6650671405825 5161174714864 5010928671263 12528216457456 6684450393318 5354960388990 5413099357131 6714834590764 17282213926713 5408651695879 6265707327729 6784123064060 6953622106733 9468750224459 5299915578487 1...
result:
ok 1000 lines
Test #2:
score: 8
Accepted
time: 3ms
memory: 12004kb
input:
1000 1000 8452879516638 -4505169642069 -1568934985623 2863473406385 4973765559677 -602315720939 -6857880176512 190631473970 -7179651039104 3471041487770 7990604293321 -9053004867012 -6729736571860 -9587690601705 9519068162544 946704932122 6562895357549 -3636659535890 -6429054959905 -1679500891093 -3...
output:
7459557453217 5063451262232 6635064523581 11154522138930 17178844321502 5289776831450 4912235879227 5235909562006 4938863908040 9707755593221 5464942400834 5453905914877 5019345284225 5207487487863 10780064124875 5559514382542 7052008564179 9603089649898 14198929792254 5396793485267 5087166869603 84...
result:
ok 1000 lines
Test #3:
score: 8
Accepted
time: 3ms
memory: 11984kb
input:
1000 1000 -9994412974983 -9965703558658 -9952998682602 -9937938818755 -9903427328517 -9899329661812 -9863320226513 -9854953154032 -9822393767696 -9806762252297 -9796220833806 -9772907292105 -9742611413046 -9738686772266 -9710641546044 -9696909817525 -9679442970812 -9655122396822 -9623134343196 -9614...
output:
2209621073052 1219406468491 3773167754211 2772692370932 1880809185004 -1466257017920 -1381434130324 4087563123288 2137670034352 4322423691464 524459059189 3157664163570 891305208978 4962633762882 2047256122232 4601231356883 -403955819451 4732850255822 -2618091508487 3632972098055 1135051209082 41028...
result:
ok 1000 lines
Test #4:
score: 8
Accepted
time: 1ms
memory: 14040kb
input:
1000 1000 -8058358408801 -8871632988727 -9415611860910 -8875043427985 -8704577168975 -9828789002738 -9156682031133 -9177007589283 -8715144205763 -8212919012409 -8458246381734 -9077755398269 -9156529824662 -8846066507092 -8617099524639 -8451119819238 -8512613822140 -9200529246653 -9573024052449 -8481...
output:
5028868689464 4972401767365 5019270132172 308063279450 -2332766210979 -2904433264654 1989714927507 1495054292961 1525888799185 1883089786696 1535400643322 4048016616407 -2001659759352 -553188465740 3292875435972 5039109894996 3515778477071 4000478119459 4076395491802 3793221043844 2023824497217 1606...
result:
ok 1000 lines
Test #5:
score: 8
Accepted
time: 2ms
memory: 11996kb
input:
1000 1000 3598213300 3596884339 1448736220 374662150 1985108766 2790332076 1045460090 173024086 1884289731 2739922562 1020255340 160421726 1877988565 2736771984 3166163683 3380859548 3488207458 3541881437 3568718414 3582136902 3588846160 3592200768 3593878066 3594716731 3595136061 3595345730 3595450...
output:
6230024896007 8448402878254 160040046213 3094252214652 7728806476954 747783337226 2048116905778 9633647211787 9890950482645 1584111111248 3133847919236 1618373463355 9895723031404 689292862779 9929938872832 8591013919235 2173107664429 2525769173181 5369162869260 8964083146261 8083598220340 907988823...
result:
ok 1000 lines
Test #6:
score: 8
Accepted
time: 4ms
memory: 11936kb
input:
1000 1000 -9999999999924 -9999999999899 -9999999999477 -9999999999525 -9999999999806 -9999999999128 -9999999999775 -9999999999755 -9999999999956 -9999999999801 -9999999999214 -9999999999864 -9999999999377 -9999999999249 -9999999999834 -9999999999550 -9999999999206 -9999999999894 -9999999999987 -9999...
output:
4999999999172 4999999999185 4999999999164 4999999999156 4999999999151 4999999999150 4999999999159 4999999999153 4999999999173 4999999999164 4999999999190 4999999999171 4999999999162 4999999999158 4999999999206 4999999999168 4999999999205 4999999999151 4999999999184 4999999999175 4999999999178 499999...
result:
ok 1000 lines
Test #7:
score: 8
Accepted
time: 1ms
memory: 11976kb
input:
1000 1000 -9959999999935 -9919999999980 -9879999999913 -9839999999964 -9799999999914 -9759999999927 -9719999999931 -9679999999907 -9640000000024 -9599999999972 -9560000000085 -9520000000048 -9479999999966 -9440000000023 -9399999999979 -9359999999962 -9320000000052 -9279999999987 -9239999999949 -9200...
output:
9887881771939 8286615760094 5930209001063 4997735212531 4996272957578 4999273685190 8483343943384 4991359001131 4341260769779 9953276377714 9954177659770 3441806608574 3286448022680 6053819248288 7050481032849 4992149804923 4998417170731 -1466323726352 9953552618459 2094960685920 9954480054626 74629...
result:
ok 1000 lines
Test #8:
score: 8
Accepted
time: 2ms
memory: 11924kb
input:
1000 1000 -9999959960168 -9999919940438 -9999879940884 -9999839961600 -9999800002368 -9999760063332 -9999720144508 -9999680245712 -9999640367164 -9999600508728 -9999560670456 -9999520852434 -9999481054586 -9999441277052 -9999401519666 -9999361782600 -9999322065648 -9999282368856 -9999242692302 -9999...
output:
-4985014550585 -4985014544346 -4985014543957 -4985014549488 -4985024466660 -4985014542331 -4985024468219 -4985014543053 -4985024465967 -4985014542786 -4985024467741 -4985024465053 -4985024467858 -4985014550993 -4985014541767 -4985014548588 -4985024463410 -4985014545806 -4985024469727 -4985014548952 ...
result:
ok 1000 lines
Subtask #2:
score: 16
Accepted
Test #9:
score: 16
Accepted
time: 88ms
memory: 20044kb
input:
60000 60000 -44 346 247 122 -265 -331 217 322 91 441 -341 -480 -135 -412 108 236 -220 -372 447 -57 397 100 -343 302 -426 299 108 -15 -421 441 289 -72 -289 -427 -496 240 15 444 -17 117 -404 -476 94 -376 412 395 193 -478 153 111 -290 -171 68 125 -130 92 -139 -159 85 26 235 -23 -487 -189 356 -116 -297 ...
output:
278 458 380 899 387 532 264 323 250 281 269 262 751 264 431 479 279 503 253 518 479 336 477 542 379 282 281 295 417 259 345 250 251 293 377 323 318 256 342 973 261 257 362 376 479 373 264 500 349 250 251 254 253 252 267 598 298 375 251 276 709 343 250 596 364 385 318 455 426 265 250 322 303 311 328 ...
result:
ok 60000 lines
Test #10:
score: 16
Accepted
time: 87ms
memory: 19904kb
input:
60000 60000 -8 140 280 -393 58 117 -149 -482 -323 -201 197 371 -33 222 -169 -340 232 -95 -353 -431 -39 -403 127 458 -93 238 196 473 -7 -266 373 197 -367 365 -158 275 -349 -358 219 -498 500 -201 -217 -216 -53 244 17 125 -200 376 -264 -182 152 43 274 -305 -403 190 75 -268 -440 1 143 -277 -50 348 454 1...
output:
455 381 325 263 316 371 481 250 267 318 263 258 356 257 313 446 320 280 633 413 435 411 271 313 388 270 259 264 398 251 292 414 899 383 279 535 384 263 317 257 255 410 278 379 251 321 556 882 335 409 346 253 520 377 405 253 335 315 479 258 837 251 333 307 258 280 328 257 306 356 509 478 334 252 252 ...
result:
ok 60000 lines
Test #11:
score: 16
Accepted
time: 64ms
memory: 19748kb
input:
60000 60000 -497 -482 -499 -486 -490 -494 -492 -481 -498 -489 -487 -487 -481 -485 -481 -491 -480 -487 -486 -486 -487 -490 -495 -495 -493 -491 -490 -491 -495 -492 -498 -480 -496 -480 -482 -486 -498 -496 -483 -484 -490 -498 -487 -493 -482 -486 -492 -482 -489 -486 -492 -499 -492 -495 -488 -497 -491 -49...
output:
189 253 151 -209 -77 -49 -30 246 50 102 4 231 132 231 -4 -89 231 221 190 253 151 231 61 50 189 230 217 41 231 -5 -77 253 -5 231 75 221 221 61 132 190 142 231 -30 123 -53 102 170 231 231 253 123 202 14 -4 110 110 246 42 31 61 -17 50 246 160 151 -70 31 92 31 4 -49 123 217 110 75 189 202 -53 246 61 110...
result:
ok 60000 lines
Test #12:
score: 16
Accepted
time: 81ms
memory: 20024kb
input:
60000 60000 -487 -410 -496 -480 -489 -482 -406 -408 -468 -429 -468 -460 -406 -403 -449 -410 -499 -433 -448 -486 -444 -409 -474 -472 -402 -468 -463 -444 -404 -422 -494 -487 -481 -482 -439 -500 -418 -490 -437 -407 -422 -410 -461 -461 -482 -408 -471 -479 -426 -446 -426 -484 -449 -453 -424 -439 -484 -44...
output:
2 61 207 185 55 107 253 179 -48 -69 205 250 250 177 9 250 209 180 186 210 207 207 15 207 256 60 208 184 250 250 250 58 -49 -150 -132 208 208 250 208 -47 -142 -88 250 108 108 -67 105 250 14 250 -83 57 250 250 180 60 64 7 8 209 104 250 250 -49 16 207 58 250 184 -143 55 250 250 250 -149 65 57 -64 208 1...
result:
ok 60000 lines
Test #13:
score: 16
Accepted
time: 15ms
memory: 12552kb
input:
60000 60000 -485 -460 -403 -425 -482 -463 -425 -409 -495 -448 -445 -412 -430 -470 -400 -497 -416 -492 -472 -463 -499 -451 -436 -414 -456 -407 -428 -498 -500 -412 -464 -458 -480 -483 -483 -422 -424 -435 -441 -418 -462 -477 -417 -457 -469 -470 -406 -494 -473 -428 -400 -490 -412 -419 -412 -469 -480 -44...
output:
264 264 264 264 263 264 264 264 264 264 265 263 265 264 265 264 264 265 265 265 265 264 265 264 265 266 264 264 265 264 264 264 263 264 265 264 264 265 265 264 264 265 265 265 264 264 266 263 263 263 263 264 264 264 264 264 265 264 265 264 265 263 266 265 264 265 264 265 263 266 265 264 265 264 263 ...
result:
ok 60000 lines
Test #14:
score: 16
Accepted
time: 86ms
memory: 21708kb
input:
60000 60000 -14 185 2 169 243 74 246 320 15 182 264 -4 167 4 175 47 225 -19 185 302 -48 182 295 -36 132 225 46 194 6 176 245 -25 146 217 -70 126 -50 154 64 248 347 48 229 67 255 47 227 317 365 24 260 373 453 29 257 381 22 179 61 272 27 229 343 62 210 300 48 300 419 30 192 266 106 294 381 16 252 383 ...
output:
347 247 267 338 246 364 504 414 253 246 438 233 248 484 568 337 250 733 385 433 430 336 244 353 303 551 259 510 837 474 243 246 468 372 284 484 395 585 246 468 243 246 279 295 458 537 463 252 511 473 490 516 332 485 250 311 241 247 268 245 246 295 348 250 251 245 244 247 525 534 274 360 248 248 434 ...
result:
ok 60000 lines
Test #15:
score: 16
Accepted
time: 66ms
memory: 19660kb
input:
60000 60000 -497 -487 -484 -497 -486 -481 -499 -487 -500 -499 -492 -490 -500 -489 -487 -484 -492 -495 -499 -483 -484 -494 -487 -489 -485 -497 -496 -480 -481 -485 -499 -491 -494 -482 -496 -499 -483 -487 -480 -495 -490 -486 -487 -487 -492 -492 -490 -497 -480 -490 -480 -481 -499 -480 -499 -480 -494 -49...
output:
161 -99 112 203 188 27 170 66 66 27 250 220 171 -122 85 210 66 151 -89 -45 72 27 211 203 -4 27 210 161 85 145 220 250 -3 250 31 171 85 161 203 95 0 112 50 134 210 151 151 27 27 31 -20 112 107 -99 151 220 240 27 -138 -122 104 210 171 151 250 188 250 171 220 161 203 134 50 -122 66 -189 203 0 220 85 17...
result:
ok 60000 lines
Test #16:
score: 16
Accepted
time: 14ms
memory: 12476kb
input:
60000 60000 -493 -492 -484 -493 -481 -486 -494 -491 -494 -487 -492 -480 -490 -493 -498 -497 -490 -493 -491 -480 -500 -486 -485 -493 -488 -498 -485 -482 -483 -496 -485 -500 -480 -484 -497 -490 -496 -482 -481 -481 -485 -497 -495 -491 -496 -498 -499 -484 -493 -483 -498 -482 -481 -484 -490 -486 -482 -48...
output:
251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 251 ...
result:
ok 60000 lines
Subtask #3:
score: 25
Accepted
Test #17:
score: 25
Accepted
time: 382ms
memory: 26084kb
input:
200000 200000 913848 -342039 -64871 -56595 657236 -386038 -13276 931318 -236480 67710 12254 -722549 -480649 -478586 -505423 -205959 -864078 -563296 -121520 -346873 236452 753483 243258 993718 689446 -771874 280196 -540198 82877 -155757 800205 73565 638304 -646889 -173448 -166166 -373244 948438 33768...
output:
742206 620593 1882679 889526 909082 577894 1461429 1359634 1510889 603868 1598690 1328372 1117451 1874834 1479312 1722751 915164 997184 672270 1253230 775309 1812993 1479412 1072202 887382 897012 979340 1414214 1258903 1666072 565208 1021302 994067 943489 737879 747850 1782904 811362 516811 529157 1...
result:
ok 200000 lines
Test #18:
score: 25
Accepted
time: 472ms
memory: 18880kb
input:
200000 200000 -841532 -877242 -994083 -923120 -944762 -890127 -831188 -908287 -924611 -874208 -912587 -844508 -971166 -996190 -849870 -937359 -830361 -853915 -874984 -958815 -803997 -981320 -868551 -968283 -850734 -927440 -841694 -849821 -864373 -869403 -833395 -801665 -918205 -922708 -941594 -97573...
output:
499538 499563 499518 499536 499543 499518 499566 499542 499519 499537 499545 499518 499548 499535 499529 499520 499537 499566 499555 499550 499563 499542 499541 499562 499540 499513 499519 499538 499556 499521 499522 499554 499516 499553 499522 499527 499527 499527 499518 499517 499534 499545 499516...
result:
ok 200000 lines
Test #19:
score: 25
Accepted
time: 475ms
memory: 18940kb
input:
200000 200000 -818245 -903581 -981109 -828674 -885767 -849867 -960852 -861774 -991168 -952812 -833951 -990960 -944130 -891428 -884958 -987034 -826626 -942531 -980588 -941922 -927248 -974694 -958616 -856794 -809762 -982476 -924837 -837104 -992009 -829794 -995626 -928750 -831731 -837728 -805778 -86722...
output:
499807 499888 499808 499804 499870 499821 499809 499842 499835 499897 499892 499829 499896 499828 499816 499861 499894 499878 499852 499856 499888 499814 499851 499856 499866 499877 499857 499861 499873 499889 499887 499824 499864 499870 499900 499817 499835 499834 499859 499901 499824 499820 499859...
result:
ok 200000 lines
Test #20:
score: 25
Accepted
time: 153ms
memory: 22380kb
input:
200000 200000 -80 -146 -13 -84 -120 -6 -159 -43 -149 -63 -103 -84 -149 -32 -157 -137 -113 -159 -110 -85 -184 -188 -3 -161 -161 -155 -174 -158 -166 -173 -157 -108 -152 -38 -21 -86 -181 -117 0 -189 -119 -59 -133 -95 -49 -181 -181 -197 -36 -74 -167 -74 -153 -172 -164 -65 -182 -172 -153 -67 -58 -92 -23 ...
output:
15024 33 15044 15009 17513 15009 15014 15008 15011 15045 15015 15007 15029 15020 15021 15053 15012 15035 15314 15044 15019 15053 15045 21182 15047 15023 15006 27904 15003 15007 15019 15006 28619 15003 15067 15014 15023 15003 15048 24318 26805 15646 15034 15030 15023 15003 15011 15008 15003 15025 150...
result:
ok 200000 lines
Test #21:
score: 25
Accepted
time: 109ms
memory: 22392kb
input:
200000 200000 -998546 -999088 -999779 -999916 -998684 -998588 -999011 -999853 -998773 -998981 -999009 -998310 -998248 -998124 -998269 -999014 -999063 -999806 -999763 -999176 -998169 -999538 -998755 -999271 -999507 -998706 -999432 -998829 -999068 -999707 -998592 -998614 -998875 -999685 -998535 -99842...
output:
150967 404443 458992 294227 348039 -241857 203019 265682 321342 325163 -237630 -56990 448254 449073 56304 17560 -96873 105132 -37836 295005 446554 369008 137390 355701 80882 395357 59053 162010 306417 461287 -365749 205825 435565 60295 217989 256041 -97794 426154 161311 112289 -333218 436178 -36430 ...
result:
ok 200000 lines
Test #22:
score: 25
Accepted
time: 144ms
memory: 22944kb
input:
200000 200000 -986155 -998853 -992892 -984051 -980122 -987189 -980872 -980923 -980049 -994501 -984891 -981912 -982235 -994619 -983173 -983309 -984781 -990216 -983456 -995449 -988330 -998624 -989139 -992224 -987510 -998963 -997324 -986796 -992977 -983896 -990668 -986718 -990837 -984441 -987340 -98903...
output:
380307 110008 75958 325969 380306 270206 31968 -295480 340656 110009 351890 490000 150778 -199961 -189098 489997 435186 176133 100010 -307270 183864 60252 -59910 480275 378859 -138390 460019 340656 300712 -212010 499996 20402 499998 416272 288909 -295493 -50065 -16794 -229294 -38121 100015 421480 31...
result:
ok 200000 lines
Test #23:
score: 25
Accepted
time: 75ms
memory: 14564kb
input:
200000 200000 -999657 -999777 -999918 -999981 -999818 -999454 -999731 -999531 -999910 -999827 -999102 -999935 -999575 -999861 -999300 -999561 -999514 -999281 -999161 -999451 -999827 -999124 -999346 -999750 -999296 -999706 -999520 -999408 -999916 -999259 -999256 -999781 -999464 -999128 -999625 -99948...
output:
499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995 499995...
result:
ok 200000 lines
Test #24:
score: 25
Accepted
time: 62ms
memory: 14072kb
input:
200000 200000 -999849 -999935 -999861 -999814 -999971 -999800 -999847 -999886 -999823 -999878 -999916 -999973 -999951 -999865 -999939 -999868 -999840 -999823 -999969 -999828 -999695 -999617 -999657 -999786 -999669 -999632 -999670 -999764 -999775 -999728 -999747 -999716 -999635 -999702 -999737 -99973...
output:
500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085 500085...
result:
ok 200000 lines
Test #25:
score: 25
Accepted
time: 179ms
memory: 15056kb
input:
200000 200000 -904245 -983711 -963179 -920440 -926495 -968058 -908805 -922695 -961875 -966003 -905937 -963269 -956730 -960822 -906532 -998771 -956409 -978038 -972338 -930031 -986631 -938916 -945831 -956088 -923477 -941876 -919040 -937205 -968359 -913018 -961112 -957807 -960236 -946601 -974115 -90121...
output:
512777 512805 512809 512804 512782 512792 512787 512806 512805 512804 512811 512780 512790 512777 512791 512787 512782 512771 512778 512780 512805 512786 512784 512804 512782 512815 512804 512782 512774 512778 512799 512776 512808 512780 512773 512775 512777 512798 512779 512811 512794 512779 512777...
result:
ok 200000 lines
Test #26:
score: 25
Accepted
time: 325ms
memory: 25044kb
input:
200000 200000 -3058 38609 59426 69841 75059 77655 78950 79616 79946 80098 8465 43051 60338 69000 73316 75465 76557 77090 77364 77514 1239 37819 56122 65254 69820 72098 73262 73843 74130 74278 74336 6481 39806 56485 64819 68990 71077 72095 72609 72877 73015 23906 61526 80335 89755 94467 96815 97996 9...
output:
70958 49983 49997 65791 63643 49982 49980 95130 72950 49994 49984 49993 49995 63474 62301 86199 49988 72559 49994 81416 49991 90713 81332 49987 85004 49995 49983 73035 49994 49991 49988 50538 49995 49985 49986 49989 93242 63672 49996 49987 49992 60907 96326 49985 49980 75147 49980 55344 58319 58284 ...
result:
ok 200000 lines
Test #27:
score: 25
Accepted
time: 224ms
memory: 23228kb
input:
200000 200000 -999945 -999995 -999991 -1000000 -999987 -999953 -999894 -999782 -999919 -999781 -999837 -999757 -999799 -999756 -999611 -999686 -999602 -999585 -999617 -999687 -999662 -999506 -999613 -999560 -999546 -999573 -999370 -999508 -999322 -999449 -999284 -999362 -999371 -999382 -999351 -9991...
output:
705099 968194 322063 418082 531280 790093 860316 584827 499998 230393 995318 817189 877991 815169 999886 115530 961071 499973 599900 723305 13213 500027 961240 567804 136705 778203 500009 837240 140765 42044 380436 477360 567728 577265 910639 544597 588777 97311 941258 749721 452860 525192 500023 94...
result:
ok 200000 lines
Test #28:
score: 25
Accepted
time: 269ms
memory: 23752kb
input:
200000 200000 -999983 -999950 -999934 -999916 -999907 -999871 -999860 -999850 -999821 -999806 -999786 -999751 -999749 -999720 -999709 -999686 -999656 -999631 -999612 -999590 -999580 -999550 -999532 -999527 -999495 -999477 -999452 -999435 -999411 -999399 -999370 -999352 -999342 -999310 -999294 -99927...
output:
823185 652387 631774 560822 984454 500357 340346 509789 912354 955566 994165 592051 666631 648596 886282 690105 840575 393854 960848 952625 932994 723801 873766 509434 222922 921396 203456 910967 732322 885162 730751 876296 618409 507063 577707 868363 504997 726452 128391 604647 52479 358160 618194 ...
result:
ok 200000 lines
Subtask #4:
score: 0
Time Limit Exceeded
Test #29:
score: 24
Accepted
time: 470ms
memory: 25940kb
input:
200000 200000 1501820709982 -8641740159116 1807928185894 -5176111206525 -6396246680430 -3656995053591 -1928464590492 2174906699258 5007462372884 8390006946946 2114610497948 7861596582144 -4604409618692 4698619907283 5124165009751 3247563497884 4694591193712 4711651614368 3548063330738 -2934984315050...
output:
5304786625735 9103515114503 5809883377455 5001728782003 5153532244330 6710699945205 9742953341599 6442926659062 5615867473573 8949863011973 6846840797275 5389417119411 5768951912321 7456783241362 5170501337042 5157900162343 5252638108826 7263187672837 5134758172889 9666179754911 5017221905380 509107...
result:
ok 200000 lines
Test #30:
score: 24
Accepted
time: 413ms
memory: 24812kb
input:
200000 200000 -9999800000075 -9999599999939 -9999400000056 -9999199999949 -9999000000081 -9998799999942 -9998600000089 -9998400000017 -9998199999963 -9998000000050 -9997800000075 -9997600000016 -9997400000055 -9997200000068 -9997000000099 -9996800000073 -9996599999943 -9996399999969 -9996200000022 -...
output:
1206462418694 4918165085681 4999999597796 6213212491308 4999999158365 4999999266223 2341578773147 5474642890167 9999709093464 394543150828 8938436936516 9767370673146 4999999964472 3132689028026 7337781271641 9431677865311 6520436371752 7230632115504 8812234364683 7889150436205 1477708690088 9143126...
result:
ok 200000 lines
Test #31:
score: 24
Accepted
time: 441ms
memory: 25132kb
input:
200000 200000 -9999800000021 -9999600000090 -9999400000002 -9999200000078 -9999000000086 -9998799999978 -9998600000009 -9998400000007 -9998199999951 -9998000000048 -9997799999944 -9997600000052 -9997399999915 -9997199999911 -9997000000041 -9996800000064 -9996599999970 -9996400000035 -9996199999929 -...
output:
4999997747435 4516421250507 510983100528 7310655865761 7854138334379 8776632526374 9139183796382 8309788341529 8228586130604 4999994072925 8916893582455 7526518513576 8406350696485 6426104275546 2527882431023 7382536404679 9999788669991 1427297187109 9688792751474 8553822120052 6189359374500 4999999...
result:
ok 200000 lines
Test #32:
score: 0
Time Limit Exceeded
input:
200000 200000 -9999999830593 -9999999819041 -9999999925057 -9999999964774 -9999999998201 -9999999977831 -9999999853576 -9999999882928 -9999999826242 -9999999881441 -9999999822881 -9999999935721 -9999999893144 -9999999992293 -9999999817654 -9999999941405 -9999999866311 -9999999996068 -9999999918114 -...
output:
result:
Subtask #5:
score: 0
Time Limit Exceeded
Test #45:
score: 27
Accepted
time: 464ms
memory: 25536kb
input:
200000 200000 1501820709982 -8641740159116 1807928185894 -5176111206525 -6396246680430 -3656995053591 -1928464590492 2174906699258 5007462372884 8390006946946 2114610497948 7861596582144 -4604409618692 4698619907283 5124165009751 3247563497884 4694591193712 4711651614368 3548063330738 -2934984315050...
output:
5304786625735 9103515114503 5809883377455 5001728782003 5153532244330 6710699945205 9742953341599 6442926659062 5615867473573 8949863011973 6846840797275 5389417119411 5768951912321 7456783241362 5170501337042 5157900162343 5252638108826 7263187672837 5134758172889 9666179754911 5017221905380 509107...
result:
ok 200000 lines
Test #46:
score: 27
Accepted
time: 419ms
memory: 25556kb
input:
200000 200000 -9999800000075 -9999599999939 -9999400000056 -9999199999949 -9999000000081 -9998799999942 -9998600000089 -9998400000017 -9998199999963 -9998000000050 -9997800000075 -9997600000016 -9997400000055 -9997200000068 -9997000000099 -9996800000073 -9996599999943 -9996399999969 -9996200000022 -...
output:
1206462418694 4918165085681 4999999597796 6213212491308 4999999158365 4999999266223 2341578773147 5474642890167 9999709093464 394543150828 8938436936516 9767370673146 4999999964472 3132689028026 7337781271641 9431677865311 6520436371752 7230632115504 8812234364683 7889150436205 1477708690088 9143126...
result:
ok 200000 lines
Test #47:
score: 27
Accepted
time: 443ms
memory: 24792kb
input:
200000 200000 -9999800000021 -9999600000090 -9999400000002 -9999200000078 -9999000000086 -9998799999978 -9998600000009 -9998400000007 -9998199999951 -9998000000048 -9997799999944 -9997600000052 -9997399999915 -9997199999911 -9997000000041 -9996800000064 -9996599999970 -9996400000035 -9996199999929 -...
output:
4999997747435 4516421250507 510983100528 7310655865761 7854138334379 8776632526374 9139183796382 8309788341529 8228586130604 4999994072925 8916893582455 7526518513576 8406350696485 6426104275546 2527882431023 7382536404679 9999788669991 1427297187109 9688792751474 8553822120052 6189359374500 4999999...
result:
ok 200000 lines
Test #48:
score: 0
Time Limit Exceeded
input:
200000 200000 -9999999830593 -9999999819041 -9999999925057 -9999999964774 -9999999998201 -9999999977831 -9999999853576 -9999999882928 -9999999826242 -9999999881441 -9999999822881 -9999999935721 -9999999893144 -9999999992293 -9999999817654 -9999999941405 -9999999866311 -9999999996068 -9999999918114 -...