QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#887211 | #10050. Bitaro the Brave 2 | modwwe | 72 | 45ms | 23352kb | C++23 | 2.6kb | 2025-02-07 15:44:49 | 2025-02-07 15:44:55 |
Judging History
answer
#pragma GCC optimize("Ofast,unroll-loops")
#include<bits/stdc++.h>
#define int long long
#define ll long long
#define down cout<<'\n';
#define debug cout<<" cucuucucuuu",down
#define NHP ios_base::sync_with_stdio(0);cout.tie(0);cin.tie(0);
#define modwwe int t;cin>>t; while(t--)
#define bit(i,j) (i>>j&1)
#define sobit(a) __builtin_popcountll(a)
#define task2 "ftree"
#define task "test"
#define fin(x) freopen(x".inp","r",stdin)
#define fou(x) freopen(x".out","w",stdout)
#define pb push_back
#define mask(k) (1<<k)
#define mp make_pair
#define checktime cerr << (double)clock() / CLOCKS_PER_SEC * 1000 << " ms";
using namespace std;
#define getchar_unlocked getchar
mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
int rand(int l,int r)
{
return uniform_int_distribution<int>(l,r)(rd);
}
inline int scan()
{
char c = getchar_unlocked();
int x = 0;
while (c < '0' || c > '9')
{
c = getchar_unlocked();
}
while (c >= '0' && c <= '9')
{
x = (x << 1) + (x << 3) + c - '0';
c = getchar_unlocked();
}
return x;
}
void phongbeo();
const int inf = 1e16;
const ll mod2 = 1e9+7;
const int mod1 = 998244353;
const ll base=67;
int add(int x,int y)
{
if(x+y>=mod2) x-=mod2;
if(x+y<0)x+=mod2;
return x+y;
}
struct icd
{
long double a;
int b;
};
struct ib
{
int a;
int b;
};
struct ic
{
int a,b,c;
};
struct id
{
int a, b, c, d;
};
struct ie
{
int a, b, c, d, e;
};
int n, m, s1, s2, s4, s3, sf, k, s5, s6, mx, s7, s8, s9, mx2, res, dem2 = 0, dem = 0, s33, dem3, dem4, mid, l2, r2, center;
int i, s10, s12,k1,k2,k3,s11,lim,w,l,r ;
int kk;
int el = 19;
main()
{
if(fopen(task2".inp","r"))
{
fin(task2);
fou(task2);
}
if(fopen(task".inp","r"))
{
fin(task);
fou(task);
}
NHP
/// cin>>s1;
//modwwe
phongbeo(),down
// checktime
}
int a[500007];
int b[500007];
int t[500007];
int suff[500007];
int pre[500007];
void phongbeo()
{
cin>>n;
for(int i=1; i<=n; i++)
cin>>a[i];
for(int i=1; i<=n; i++)
cin>>b[i],b[i]+=b[i-1];
for(int i=1; i<=n; i++)
{
t[i]=a[i]-b[i-1];
}
suff[n+1]=-1e12;
pre[0]=-1e12;
for(int i=n; i>=1; --i)
suff[i]=max(suff[i+1],t[i]);
for(int i=1; i<=n; i++)
pre[i]=max(pre[i-1],t[i]);
s4=1e9+1;
for(int i=1; i<=n; i++)
{
s5=max({pre[i-1]-b[n]+b[i-1],suff[i]+b[i-1],0ll});
s4=min(s4,s5);
}
cout<<s4;
}
详细
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 0ms
memory: 12016kb
input:
2000 10 9 9 9 9 9 10 9 10 10 9 10 9 10 9 9 10 9 9 9 10 9 10 10 9 10 10 9 9 10 9 10 10 10 9 10 10 9 10 9 9 10 10 9 9 9 9 9 9 9 9 10 9 10 10 10 9 10 9 9 10 9 10 10 10 10 10 9 10 10 10 9 9 9 9 10 9 10 9 10 9 10 10 10 10 9 9 10 10 9 9 9 9 10 9 10 10 10 9 9 9 10 9 9 9 9 10 10 10 9 10 10 10 10 9 10 9 10 9...
output:
9
result:
ok single line: '9'
Test #2:
score: 10
Accepted
time: 0ms
memory: 11888kb
input:
2000 9 9 10 9 10 9 10 9 9 9 10 10 9 10 10 9 9 10 9 10 10 9 10 9 9 9 10 10 10 10 9 10 9 10 9 9 10 9 9 9 9 9 10 10 9 9 9 10 9 9 10 9 9 9 9 10 10 9 10 10 10 10 10 9 9 10 10 9 9 9 9 10 10 10 9 10 9 9 10 9 9 10 9 9 9 10 9 10 10 9 9 10 10 9 9 9 10 9 10 9 10 9 9 10 9 9 9 10 9 10 9 9 9 9 10 9 9 10 10 9 10 1...
output:
9
result:
ok single line: '9'
Test #3:
score: 10
Accepted
time: 0ms
memory: 11884kb
input:
2000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
0
result:
ok single line: '0'
Test #4:
score: 10
Accepted
time: 1ms
memory: 12012kb
input:
2000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
0
result:
ok single line: '0'
Test #5:
score: 10
Accepted
time: 0ms
memory: 11884kb
input:
2000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
0
result:
ok single line: '0'
Test #6:
score: 10
Accepted
time: 1ms
memory: 12012kb
input:
2000 8 6 6 8 8 9 7 6 8 7 10 8 6 8 9 8 10 9 10 10 6 6 10 9 7 8 9 9 7 9 6 10 6 8 6 9 8 10 10 8 9 6 10 10 7 9 10 7 7 10 9 10 10 9 9 10 7 9 8 7 7 9 6 6 9 9 9 6 7 8 8 8 10 8 7 9 10 7 9 6 8 6 6 6 10 10 8 8 9 8 7 9 8 8 10 9 7 6 7 7 7 6 8 10 6 8 9 9 10 9 10 10 7 10 9 7 9 9 6 9 10 6 7 7 10 9 8 7 9 8 8 6 9 10...
output:
10
result:
ok single line: '10'
Test #7:
score: 10
Accepted
time: 1ms
memory: 11888kb
input:
2000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
8
result:
ok single line: '8'
Test #8:
score: 10
Accepted
time: 0ms
memory: 14060kb
input:
2000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
10
result:
ok single line: '10'
Test #9:
score: 10
Accepted
time: 0ms
memory: 11976kb
input:
2000 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
8
result:
ok single line: '8'
Test #10:
score: 10
Accepted
time: 0ms
memory: 11884kb
input:
2000 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
9
result:
ok single line: '9'
Subtask #2:
score: 21
Accepted
Test #11:
score: 21
Accepted
time: 0ms
memory: 12016kb
input:
2000 100000000 100000001 100000002 100000003 100000004 100000005 100000006 100000007 100000008 100000009 100000010 100000011 100000012 100000013 100000014 100000015 100000016 100000017 100000018 100000019 100000020 100000021 100000022 100000023 100000024 100000025 100000026 100000027 100000028 10000...
output:
99999489
result:
ok single line: '99999489'
Test #12:
score: 21
Accepted
time: 0ms
memory: 12012kb
input:
2000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
1000000000
result:
ok single line: '1000000000'
Test #13:
score: 21
Accepted
time: 0ms
memory: 12008kb
input:
2000 100000000 99999999 99999998 99999997 99999996 99999995 99999994 99999993 99999992 99999991 99999990 99999989 99999988 99999987 99999986 99999985 99999984 99999983 99999982 99999981 99999980 99999979 99999978 99999977 99999976 99999975 99999974 99999973 99999972 99999971 99999970 99999969 999999...
output:
99999017
result:
ok single line: '99999017'
Test #14:
score: 21
Accepted
time: 2ms
memory: 12012kb
input:
2000 99999990 99999990 99999993 99999995 99999994 99999999 99999999 99999993 99999992 99999993 99999996 99999995 99999998 99999999 99999995 99999997 99999991 99999991 99999991 99999999 99999997 99999995 99999992 99999992 99999994 99999997 99999990 99999998 99999990 99999992 99999999 99999995 9999999...
output:
99999995
result:
ok single line: '99999995'
Test #15:
score: 21
Accepted
time: 0ms
memory: 11880kb
input:
2000 99999997 99999998 99999994 99999999 99999996 99999994 99999997 99999997 99999993 99999998 99999997 99999998 99999999 99999991 99999999 99999992 99999995 99999994 99999992 99999991 99999991 99999995 99999997 99999997 99999990 99999999 99999998 99999998 99999998 99999991 99999997 99999994 9999999...
output:
99999996
result:
ok single line: '99999996'
Test #16:
score: 21
Accepted
time: 0ms
memory: 11884kb
input:
2000 99999996 99999998 99999997 99999993 99999997 99999998 99999995 99999990 99999995 99999999 99999994 99999997 99999994 99999997 99999991 99999998 99999996 99999992 99999997 99999997 99999992 99999990 99999999 99999997 99999990 99999998 99999998 99999999 99999997 99999990 99999992 99999999 9999999...
output:
99999996
result:
ok single line: '99999996'
Test #17:
score: 21
Accepted
time: 1ms
memory: 12012kb
input:
2000 500000000 595954395 500000000 719922556 500000000 673855701 500000000 524733105 500000000 569117483 500000000 645988962 500000000 618369893 500000000 603500273 500000000 703349061 500000000 744916082 500000000 640655652 500000000 523816441 500000000 673995695 500000000 569697107 500000000 71052...
output:
740407931
result:
ok single line: '740407931'
Test #18:
score: 21
Accepted
time: 0ms
memory: 11884kb
input:
2000 500000000 521755178 456489644 500000000 546667566 406664868 500000000 530279196 439441608 500000000 581555724 336888552 500000000 652694037 194611926 500000000 582467170 335065660 500000000 504346000 491308000 500000000 629620007 240759986 500000000 642779991 214440018 500000000 646764177 20647...
output:
661631870
result:
ok single line: '661631870'
Test #19:
score: 21
Accepted
time: 0ms
memory: 11888kb
input:
2000 500000000 552697382 605394764 341907854 500000000 509601020 519202040 471196940 500000000 614172225 728344450 157483325 500000000 610176729 720353458 169469813 500000000 605313640 710627280 184059080 500000000 605975345 711950690 182073965 500000000 543566392 587132784 369300824 500000000 55783...
output:
742359908
result:
ok single line: '742359908'
Test #20:
score: 21
Accepted
time: 0ms
memory: 12012kb
input:
2000 500000000 541907823 583815646 374276531 332368708 500000000 570171481 640342962 289485557 219314076 500000000 592827464 685654928 221517608 128690144 500000000 557436775 614873550 327689675 270252900 500000000 556968155 613936310 329095535 272127380 500000000 583513888 667027776 249458336 16594...
output:
686324284
result:
ok single line: '686324284'
Test #21:
score: 21
Accepted
time: 0ms
memory: 12012kb
input:
2000 500000000 536137908 572275816 608413724 644551632 680689540 283172552 247034644 210896736 174758828 500000000 540969022 581938044 622907066 663876088 704845110 254185868 213216846 172247824 131278802 500000000 510166059 520332118 530498177 540664236 550830295 439003646 428837587 418671528 40850...
output:
737919838
result:
ok single line: '737919838'
Test #22:
score: 21
Accepted
time: 0ms
memory: 11888kb
input:
2000 500000000 500926607 501853214 502779821 503706428 504633035 505559642 506486249 507412856 508339463 509266070 510192677 511119284 512045891 512972498 513899105 514825712 515752319 516678926 517605533 518532140 519458747 520385354 521311961 522238568 523165175 524091782 525018389 525944996 52687...
output:
727326597
result:
ok single line: '727326597'
Test #23:
score: 21
Accepted
time: 0ms
memory: 11888kb
input:
2000 500000 500484 500968 498548 500000 500633 501266 498101 500000 500606 501212 498182 500000 500597 501194 498209 500000 500585 501170 498245 500000 500576 501152 498272 500000 500575 501150 498275 500000 500360 500720 498920 500000 500380 500760 498860 500000 500412 500824 498764 500000 500693 5...
output:
1992
result:
ok single line: '1992'
Test #24:
score: 21
Accepted
time: 0ms
memory: 11888kb
input:
2000 500000 500606 501212 498182 500000 500374 500748 498878 500000 500348 500696 498956 500000 500391 500782 498827 500000 500507 501014 498479 500000 500337 500674 498989 500000 500638 501276 498086 500000 500341 500682 498977 500000 500664 501328 498008 500000 500664 501328 498008 500000 500334 5...
output:
1977
result:
ok single line: '1977'
Test #25:
score: 21
Accepted
time: 0ms
memory: 12016kb
input:
2000 500000 500470 500940 498590 498120 500000 500639 501278 498083 497444 500000 500622 501244 498134 497512 500000 500393 500786 498821 498428 500000 500511 501022 498467 497956 500000 500381 500762 498857 498476 500000 500624 501248 498128 497504 500000 500420 500840 498740 498320 500000 500317 5...
output:
1958
result:
ok single line: '1958'
Test #26:
score: 21
Accepted
time: 0ms
memory: 11888kb
input:
2000 500000 500418 500836 501254 501672 502090 497492 497074 496656 496238 500000 500430 500860 501290 501720 502150 497420 496990 496560 496130 500000 500536 501072 501608 502144 502680 496784 496248 495712 495176 500000 500345 500690 501035 501380 501725 497930 497585 497240 496895 500000 500382 5...
output:
2014
result:
ok single line: '2014'
Subtask #3:
score: 19
Accepted
Test #27:
score: 19
Accepted
time: 34ms
memory: 23348kb
input:
500000 3 4 10 8 4 3 8 10 1 7 2 5 5 4 8 6 5 9 1 6 5 7 2 9 7 1 6 7 9 6 5 3 2 5 9 8 5 9 7 6 3 8 6 4 7 4 2 1 3 7 9 5 2 10 4 6 3 5 7 7 2 1 3 1 6 7 5 6 8 7 10 6 10 8 5 9 3 4 5 7 9 2 4 2 10 2 5 1 8 1 5 1 5 6 10 7 6 4 6 3 5 9 7 1 7 10 8 8 7 2 3 4 10 3 8 4 1 6 6 1 1 7 5 9 8 1 6 2 2 5 1 1 3 3 1 3 4 1 9 1 5 6 ...
output:
1
result:
ok single line: '1'
Test #28:
score: 19
Accepted
time: 35ms
memory: 23220kb
input:
500000 10 8 9 8 8 10 8 10 9 8 10 10 10 8 8 10 9 9 10 10 9 10 9 9 9 8 8 10 8 9 8 8 9 8 10 8 10 9 10 10 9 8 9 9 9 8 10 10 8 8 10 8 9 8 8 10 10 9 10 9 9 9 9 10 10 9 10 8 8 10 9 8 10 10 8 10 9 9 9 8 10 9 10 9 10 10 8 9 9 10 8 8 9 9 8 8 9 8 8 8 10 9 9 9 10 10 9 10 8 8 9 10 8 10 10 9 8 10 10 9 8 9 10 10 8...
output:
8
result:
ok single line: '8'
Test #29:
score: 19
Accepted
time: 34ms
memory: 23224kb
input:
500000 9 10 6 4 1 1 1 9 1 4 2 9 0 1 7 7 2 10 1 3 0 3 7 1 1 2 9 6 9 8 3 5 4 1 0 1 9 0 8 7 2 0 10 3 7 1 7 10 7 9 9 0 9 5 7 5 6 8 2 10 8 5 4 5 1 6 9 0 9 5 4 5 0 5 2 3 4 6 1 9 7 6 9 3 4 6 1 1 6 9 10 10 9 5 7 10 1 4 2 0 3 3 8 0 8 5 7 10 3 0 0 1 8 2 7 5 2 7 9 8 1 10 0 8 3 1 4 3 3 8 4 10 8 8 4 6 1 6 6 6 10...
output:
0
result:
ok single line: '0'
Test #30:
score: 19
Accepted
time: 35ms
memory: 23224kb
input:
500000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
8
result:
ok single line: '8'
Test #31:
score: 19
Accepted
time: 33ms
memory: 23344kb
input:
500000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
10
result:
ok single line: '10'
Test #32:
score: 19
Accepted
time: 34ms
memory: 23352kb
input:
500000 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21...
output:
8
result:
ok single line: '8'
Test #33:
score: 19
Accepted
time: 39ms
memory: 23220kb
input:
500000 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21...
output:
8
result:
ok single line: '8'
Test #34:
score: 19
Accepted
time: 35ms
memory: 23348kb
input:
500000 9 9 9 10 9 9 9 9 10 9 9 9 9 9 9 9 9 9 10 9 9 9 9 9 10 9 10 9 9 10 9 10 9 10 10 10 9 10 10 9 9 10 10 10 9 9 9 10 9 9 9 10 10 10 9 9 10 9 9 10 10 9 9 9 10 9 9 9 9 9 10 9 10 9 10 10 9 10 9 10 10 10 9 10 10 10 9 10 9 10 10 9 10 9 9 9 9 10 9 9 10 10 9 9 9 9 10 9 10 9 10 10 9 9 9 9 10 9 10 9 10 9 9...
output:
9
result:
ok single line: '9'
Test #35:
score: 19
Accepted
time: 38ms
memory: 23220kb
input:
500000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
0
result:
ok single line: '0'
Test #36:
score: 19
Accepted
time: 35ms
memory: 23352kb
input:
500000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
0
result:
ok single line: '0'
Test #37:
score: 19
Accepted
time: 39ms
memory: 23224kb
input:
500000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
0
result:
ok single line: '0'
Test #38:
score: 19
Accepted
time: 38ms
memory: 23352kb
input:
500000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
0
result:
ok single line: '0'
Test #39:
score: 19
Accepted
time: 32ms
memory: 23352kb
input:
500000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
0
result:
ok single line: '0'
Test #40:
score: 19
Accepted
time: 35ms
memory: 23092kb
input:
500000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
0
result:
ok single line: '0'
Test #41:
score: 19
Accepted
time: 34ms
memory: 23220kb
input:
500000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
0
result:
ok single line: '0'
Subtask #4:
score: 22
Accepted
Test #42:
score: 22
Accepted
time: 35ms
memory: 23352kb
input:
500000 500000 500064 500128 500192 500256 500320 500384 500448 500512 500576 500640 500704 500768 500832 500896 500960 501024 501088 501152 501216 501280 501344 501408 501472 501536 501600 501664 501728 501792 501856 501920 501984 502048 502112 502176 502240 502304 502368 502432 502496 502560 502624...
output:
499499
result:
ok single line: '499499'
Test #43:
score: 22
Accepted
time: 36ms
memory: 23220kb
input:
500000 500000 500061 500122 500183 500244 500305 500366 500427 500488 500549 500610 500671 500732 500793 500854 500915 500976 501037 501098 501159 501220 501281 501342 501403 501464 501525 501586 501647 501708 501769 501830 501891 501952 502013 502074 502135 502196 502257 502318 502379 502440 502501...
output:
531001
result:
ok single line: '531001'
Test #44:
score: 22
Accepted
time: 34ms
memory: 23344kb
input:
500000 500000 500082 500164 500246 500328 500410 500492 500574 500656 500738 500820 500902 500984 501066 501148 501230 501312 501394 501476 501558 501640 501722 501804 501886 501968 502050 502132 502214 502296 502378 502460 502542 502624 502706 502788 502870 502952 503034 503116 503198 503280 503362...
output:
499949
result:
ok single line: '499949'
Test #45:
score: 22
Accepted
time: 35ms
memory: 23220kb
input:
500000 500000 500005 500010 500015 500020 500025 500030 500035 500040 500045 500050 500055 500060 500065 500070 500075 500080 500085 500090 500095 500100 500105 500110 500115 500120 500125 500130 500135 500140 500145 500150 500155 500160 500165 500170 500175 500180 500185 500190 500195 500200 500205...
output:
502451
result:
ok single line: '502451'
Test #46:
score: 22
Accepted
time: 35ms
memory: 23344kb
input:
500000 500000 500014 500028 500042 500056 500070 500084 500098 500112 500126 500140 500154 500168 500182 500196 500210 500224 500238 500252 500266 500280 500294 500308 500322 500336 500350 500364 500378 500392 500406 500420 500434 500448 500462 500476 500490 500504 500518 500532 500546 500560 500574...
output:
502601
result:
ok single line: '502601'
Test #47:
score: 22
Accepted
time: 35ms
memory: 23348kb
input:
500000 500000 500030 500060 499910 500000 500081 500162 499757 500000 500006 500012 499982 500000 500030 500060 499910 500000 500094 500188 499718 500000 500021 500042 499937 500000 500060 500120 499820 500000 500056 500112 499832 500000 500080 500160 499760 500000 500057 500114 499829 500000 500091...
output:
499997
result:
ok single line: '499997'
Test #48:
score: 22
Accepted
time: 35ms
memory: 23224kb
input:
500000 500000 500091 500182 499727 499636 500000 500015 500030 499955 499940 500000 500058 500116 499826 499768 500000 500097 500194 499709 499612 500000 500003 500006 499991 499988 500000 500035 500070 499895 499860 500000 500002 500004 499994 499992 500000 500012 500024 499964 499952 500000 500089...
output:
500068
result:
ok single line: '500068'
Test #49:
score: 22
Accepted
time: 36ms
memory: 23140kb
input:
500000 500000 500017 500034 499949 499932 500000 500059 500118 499823 499764 500000 500097 500194 499709 499612 500000 500006 500012 499982 499976 500000 500063 500126 499811 499748 500000 500020 500040 499940 499920 500000 500092 500184 499724 499632 500000 500033 500066 499901 499868 500000 500015...
output:
500078
result:
ok single line: '500078'
Test #50:
score: 22
Accepted
time: 34ms
memory: 23220kb
input:
500000 500000 500073 500146 499781 499708 500000 500037 500074 499889 499852 500000 500050 500100 499850 499800 500000 500079 500158 499763 499684 500000 500056 500112 499832 499776 500000 500062 500124 499814 499752 500000 500006 500012 499982 499976 500000 500047 500094 499859 499812 500000 500067...
output:
500082
result:
ok single line: '500082'
Test #51:
score: 22
Accepted
time: 38ms
memory: 23352kb
input:
500000 500000 500055 500110 499835 499780 500000 500064 500128 499808 499744 500000 500100 500200 499700 499600 500000 500049 500098 499853 499804 500000 500058 500116 499826 499768 500000 500093 500186 499721 499628 500000 500060 500120 499820 499760 500000 500025 500050 499925 499900 500000 500055...
output:
499996
result:
ok single line: '499996'
Test #52:
score: 22
Accepted
time: 37ms
memory: 23352kb
input:
500000 500000 500093 500186 500279 500372 500465 499442 499349 499256 499163 500000 500054 500108 500162 500216 500270 499676 499622 499568 499514 500000 500008 500016 500024 500032 500040 499952 499944 499936 499928 500000 500020 500040 500060 500080 500100 499880 499860 499840 499820 500000 500070...
output:
500191
result:
ok single line: '500191'
Test #53:
score: 22
Accepted
time: 35ms
memory: 23220kb
input:
500000 500000 500056 500112 500168 500224 500280 499664 499608 499552 499496 500000 500099 500198 500297 500396 500495 499406 499307 499208 499109 500000 500001 500002 500003 500004 500005 499994 499993 499992 499991 500000 500073 500146 500219 500292 500365 499562 499489 499416 499343 500000 500062...
output:
500221
result:
ok single line: '500221'
Test #54:
score: 22
Accepted
time: 36ms
memory: 23352kb
input:
500000 500000 500048 500096 500144 500192 500240 499712 499664 499616 499568 500000 500070 500140 500210 500280 500350 499580 499510 499440 499370 500000 500065 500130 500195 500260 500325 499610 499545 499480 499415 500000 500045 500090 500135 500180 500225 499730 499685 499640 499595 500000 500065...
output:
499994
result:
ok single line: '499994'
Test #55:
score: 22
Accepted
time: 36ms
memory: 23220kb
input:
500000 500000 500062 500124 500186 500248 500310 499628 499566 499504 499442 500000 500086 500172 500258 500344 500430 499484 499398 499312 499226 500000 500006 500012 500018 500024 500030 499964 499958 499952 499946 500000 500041 500082 500123 500164 500205 499754 499713 499672 499631 500000 500081...
output:
499994
result:
ok single line: '499994'
Subtask #5:
score: 0
Wrong Answer
Test #56:
score: 28
Accepted
time: 35ms
memory: 23348kb
input:
500000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
1000000000
result:
ok single line: '1000000000'
Test #57:
score: 0
Wrong Answer
time: 45ms
memory: 23216kb
input:
500000 878732262 659850111 642167668 527055743 874918922 910516925 632227950 347446862 789657007 199359454 271738438 413064348 380649122 749297150 271061420 547940090 988295141 857908755 423119545 951447379 653726190 751491775 36946795 133415601 340869239 473110303 389127597 765480107 169286051 1172...
output:
586973
result:
wrong answer 1st lines differ - expected: '2573', found: '586973'