#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define a first
#define b second
#define pb push_back
//#define endl '\n'
llo n,dd;
llo it[350];
llo cc[601];
int dp[2000001];
deque<pair<int,int>> zz[301];
llo ans=-1;
llo su3=0;
llo su5=0;
void apply(int l,int r){
for(int j=l;j<=r;j++){
if(j==n){
continue;
}
//cout<<j<<",,"<<endl;
if(j<n){
su5-=abs(j-n)*min(cc[j],n);
}
else{
su3+=abs(j-n)*min(cc[j],n);
}
//cout<<j<<","<<su5<<endl;
llo ax=(j-n)*min(cc[j],n);
//su3=max(su3,su3+ax);
//su5=min(su5,su3+ax);
//llo su3=n*n*n;
for(int i=0;i<abs(j-n);i++){
zz[i].clear();
}
if(j<n){
int y=su3%abs(j-n);
int z=su3/abs(j-n);
if(cc[j]==0){
continue;
}
for(int ii=su3;ii>=su5;ii--){
//llo y=ii%abs(j-n);
//llo z=ii/abs(j-n);
if(dp[ii]>=0){
pair<llo,llo> cur={dp[ii]+z,ii};
while(zz[y].size()){
if(zz[y].back().a>=cur.a){
zz[y].pop_back();
}
else{
break;
}
}
zz[y].pb(cur);
}
while(zz[y].size()){
if(zz[y].front().b>ii+abs(ax)){
zz[y].pop_front();
}
else{
break;
}
}
if(zz[y].size()){
int xx=zz[y].front().a-z;
if(dp[ii]==-1){
dp[ii]=xx;
}
dp[ii]=min(dp[ii],xx);
}
y--;
if(y==-1){
y=abs(j-n)-1;
z--;
}
/*y++;
if(y==j){
y=0;
z++;
}*/
}
}
else{
if(cc[j]==0){
continue;
}
int y=su5%abs(j-n);
int z=su5/abs(j-n);
for(int ii=su5;ii<=su3;ii++){
if(dp[ii]>=0){
pair<int,int> cur={dp[ii]-z,ii};
while(zz[y].size()){
if(zz[y].back().a>=cur.a){
zz[y].pop_back();
}
else{
break;
}
}
zz[y].pb(cur);
}
while(zz[y].size()){
if(zz[y].front().b<ii-ax){
zz[y].pop_front();
}
else{
break;
}
}
if(zz[y].size()){
int xx=zz[y].front().a+z;
if(dp[ii]==-1){
dp[ii]=xx;
}
dp[ii]=min(dp[ii],xx);
}
y++;
if(y==abs(j-n)){
y=0;
z++;
}
}
}
//cout<<j<<",,"<<endl;
}
}
void remove(int l,int r){
for(int j=l;j<=r;j++){
if(j<n){
su5+=abs(j-n)*min(cc[j],n);
}
else if(j>n){
su3-=abs(j-n)*min(cc[j],n);
}
}
}
llo pp;
void solve(int l,int r){
if(l==r){
if(l==n){
return;
}
llo ac=0;
llo ac2=0;
if(l>n){
for(int j=r+1;j<=2*n;j++){
ac+=((cc[j]-min(cc[j],n)))*(j-n);
ac2+=(cc[j]-min(cc[j],n));
}
/*for(int j=0;j<n;j++){
ac+=((cc[j]-min(cc[j],n)))*(j-n);
ac2+=(cc[j]-min(cc[j],n));
}*/
}
else{
for(int j=0;j<l;j++){
ac+=((cc[j]-min(cc[j],n)))*(j-n);
ac2+=(cc[j]-min(cc[j],n));
}
/*for(int j=n+1;j<=2*n;j++){
ac+=((cc[j]-min(cc[j],n)))*(j-n);
ac2+=(cc[j]-min(cc[j],n));
}*/
}
/*if(ac>pp){
return;
}*/
llo cur2=pp-ac;
int i=l;
/* if(r==4){
cout<<ac<<":"<<pp<<endl;
}*/
//cout<<i<<"::"<<l<<endl;
//cout<<cur2<<",,"<<ac<<","<<pp<<endl;
//cout<<dp[n*n*n]<<","<<endl;
llo acc=((abs(cur2)))%(abs(i-n));
llo ccc=acc-(su5%(abs(i-n)))+abs(i-n);
ccc%=abs(i-n);
for(llo j=su5+ccc;j<=su3;j+=abs(i-n)){
if(i==n){
continue;
}
if(dp[j]>=0){
llo x=abs(cur2-j)/abs(i-n);
if(i<n){
x=-x;
}
if(cur2-j<0){
x=-x;
}
if(x<=cc[i] and x>=0){
llo y=dp[j]+x;
y+=ac2;
if(ans==-1){
ans=y;
}
ans=min(ans,y);
}
}
}
/*ac=0;
ac2=0;
for(int j=0;j<l;j++){
ac+=((cc[j]-min(cc[j],n)))*(j-n);
ac2+=(cc[j]-min(cc[j],n));
}
cur2=pp-ac;
for(llo j=su5;j<=su3;j++){
if(i==n){
continue;
}
// for(llo j=cur2%i;j<=su3 and j<=cur2;j+=i){
if(dp[j]>=0){
//if(l-n==1){
//cout<<(j-n*n*n)<<":::"<<endl;
//}
int ok=1;
if(i<n){
ok=-1;
}
if(abs(cur2-j)%abs(i-n)==0){
llo x=(cur2-j)/abs(i-n);
x*=ok;
if(cur2-j<0){
x=-x;
}
if(x<=cc[i] and x>=0){
llo y=dp[j]+x;
y+=ac2;
if(ans==-1){
ans=y;
}
ans=min(ans,y);
}
}
}
}*/
}
else{
int mid=(l+r)/2;
vector<llo> dp2;
for(int ii=su5;ii<=su3;ii++){
dp2.pb(dp[ii]);
}
pair<llo,llo> cur={su5,su3};
apply(l,mid);
solve(mid+1,r);
for(int ii=su5;ii<=su3;ii++){
dp[ii]=-1;
}
for(int ii=cur.a;ii<=cur.b;ii++){
dp[ii]=dp2[ii-cur.a];
}
remove(l,mid);
dp2.clear();
for(int ii=su5;ii<=su3;ii++){
dp2.pb(dp[ii]);
}
cur={su5,su3};
apply(mid+1,r);
solve(l,mid);
for(int ii=su5;ii<=su3;ii++){
dp[ii]=-1;
}
for(int ii=cur.a;ii<=cur.b;ii++){
dp[ii]=dp2[ii-cur.a];
}
remove(mid+1,r);
}
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin>>n>>dd;
llo cot=0;
llo ma=0;
llo acc=0;
llo su=0;
for(llo i=0;i<n;i++){
llo aa;
cin>>aa;
su+=aa*(i-n);
cot+=aa;
cc[i]=aa;
acc+=aa;
}
for(llo i=0;i<=n;i++){
cin>>it[i];
su+=it[i]*i;
cot+=it[i];
cc[n+i]=it[i];
}
for(llo i=0;i<=2*n;i++){
ma=max(ma,cc[i]);
}
for(int i=1;i<=n;i++){
}
//cout<<cc[4]<<":"<<endl;
//su3=0;
/* if(su<dd){
cout<<"impossible"<<endl;
return 0;
}*/
llo cur=su-dd;
pp=cur;
pp+=n*n*n;
su3+=n*n*n;
su5+=n*n*n;
it[0]=0;
for(int i=0;i<=2e6;i++){
dp[i]=-1;
}
dp[(n*n*n)]=0;
solve(0,2*n);
if(ans==-1){
cout<<"impossible"<<endl;
}
else{
//cout<<ans<<endl;
cout<<cot-ans<<endl;
}
//else find minimum number of elements with sum su-dd
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
8276 KB |
Output is correct |
2 |
Correct |
3 ms |
8276 KB |
Output is correct |
3 |
Correct |
3 ms |
8276 KB |
Output is correct |
4 |
Correct |
4 ms |
8276 KB |
Output is correct |
5 |
Correct |
447 ms |
11644 KB |
Output is correct |
6 |
Correct |
484 ms |
12648 KB |
Output is correct |
7 |
Correct |
104 ms |
9852 KB |
Output is correct |
8 |
Correct |
460 ms |
11524 KB |
Output is correct |
9 |
Correct |
842 ms |
14712 KB |
Output is correct |
10 |
Correct |
8 ms |
8660 KB |
Output is correct |
11 |
Correct |
7 ms |
8564 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
8276 KB |
Output is correct |
2 |
Correct |
3 ms |
8276 KB |
Output is correct |
3 |
Correct |
3 ms |
8276 KB |
Output is correct |
4 |
Correct |
4 ms |
8276 KB |
Output is correct |
5 |
Correct |
447 ms |
11644 KB |
Output is correct |
6 |
Correct |
484 ms |
12648 KB |
Output is correct |
7 |
Correct |
104 ms |
9852 KB |
Output is correct |
8 |
Correct |
460 ms |
11524 KB |
Output is correct |
9 |
Correct |
842 ms |
14712 KB |
Output is correct |
10 |
Correct |
8 ms |
8660 KB |
Output is correct |
11 |
Correct |
7 ms |
8564 KB |
Output is correct |
12 |
Correct |
4 ms |
8276 KB |
Output is correct |
13 |
Correct |
3 ms |
8276 KB |
Output is correct |
14 |
Correct |
3 ms |
8276 KB |
Output is correct |
15 |
Correct |
4 ms |
8276 KB |
Output is correct |
16 |
Correct |
440 ms |
11692 KB |
Output is correct |
17 |
Correct |
446 ms |
12796 KB |
Output is correct |
18 |
Correct |
102 ms |
9872 KB |
Output is correct |
19 |
Correct |
414 ms |
11596 KB |
Output is correct |
20 |
Correct |
824 ms |
14632 KB |
Output is correct |
21 |
Correct |
9 ms |
8644 KB |
Output is correct |
22 |
Correct |
8 ms |
8564 KB |
Output is correct |
23 |
Execution timed out |
5059 ms |
38004 KB |
Time limit exceeded |
24 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
8276 KB |
Output is correct |
2 |
Correct |
20 ms |
8864 KB |
Output is correct |
3 |
Correct |
7 ms |
8512 KB |
Output is correct |
4 |
Correct |
23 ms |
8936 KB |
Output is correct |
5 |
Correct |
31 ms |
8996 KB |
Output is correct |
6 |
Correct |
19 ms |
8680 KB |
Output is correct |
7 |
Correct |
4 ms |
8404 KB |
Output is correct |
8 |
Correct |
4 ms |
8404 KB |
Output is correct |
9 |
Correct |
7 ms |
8532 KB |
Output is correct |
10 |
Correct |
12 ms |
8636 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
8276 KB |
Output is correct |
2 |
Correct |
20 ms |
8864 KB |
Output is correct |
3 |
Correct |
7 ms |
8512 KB |
Output is correct |
4 |
Correct |
23 ms |
8936 KB |
Output is correct |
5 |
Correct |
31 ms |
8996 KB |
Output is correct |
6 |
Correct |
19 ms |
8680 KB |
Output is correct |
7 |
Correct |
4 ms |
8404 KB |
Output is correct |
8 |
Correct |
4 ms |
8404 KB |
Output is correct |
9 |
Correct |
7 ms |
8532 KB |
Output is correct |
10 |
Correct |
12 ms |
8636 KB |
Output is correct |
11 |
Correct |
4 ms |
8276 KB |
Output is correct |
12 |
Correct |
4 ms |
8276 KB |
Output is correct |
13 |
Correct |
4 ms |
8276 KB |
Output is correct |
14 |
Correct |
5 ms |
8276 KB |
Output is correct |
15 |
Correct |
21 ms |
8860 KB |
Output is correct |
16 |
Correct |
7 ms |
8512 KB |
Output is correct |
17 |
Correct |
28 ms |
8924 KB |
Output is correct |
18 |
Correct |
37 ms |
9012 KB |
Output is correct |
19 |
Correct |
18 ms |
8720 KB |
Output is correct |
20 |
Correct |
5 ms |
8456 KB |
Output is correct |
21 |
Correct |
4 ms |
8404 KB |
Output is correct |
22 |
Correct |
7 ms |
8532 KB |
Output is correct |
23 |
Correct |
12 ms |
8636 KB |
Output is correct |
24 |
Correct |
75 ms |
9556 KB |
Output is correct |
25 |
Correct |
20 ms |
8904 KB |
Output is correct |
26 |
Correct |
115 ms |
9524 KB |
Output is correct |
27 |
Correct |
74 ms |
9492 KB |
Output is correct |
28 |
Correct |
94 ms |
9308 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
8276 KB |
Output is correct |
2 |
Correct |
20 ms |
8864 KB |
Output is correct |
3 |
Correct |
7 ms |
8512 KB |
Output is correct |
4 |
Correct |
23 ms |
8936 KB |
Output is correct |
5 |
Correct |
31 ms |
8996 KB |
Output is correct |
6 |
Correct |
19 ms |
8680 KB |
Output is correct |
7 |
Correct |
4 ms |
8404 KB |
Output is correct |
8 |
Correct |
4 ms |
8404 KB |
Output is correct |
9 |
Correct |
7 ms |
8532 KB |
Output is correct |
10 |
Correct |
12 ms |
8636 KB |
Output is correct |
11 |
Correct |
4 ms |
8276 KB |
Output is correct |
12 |
Correct |
20 ms |
8860 KB |
Output is correct |
13 |
Correct |
8 ms |
8512 KB |
Output is correct |
14 |
Correct |
22 ms |
8924 KB |
Output is correct |
15 |
Correct |
37 ms |
9096 KB |
Output is correct |
16 |
Correct |
19 ms |
8668 KB |
Output is correct |
17 |
Correct |
5 ms |
8404 KB |
Output is correct |
18 |
Correct |
5 ms |
8404 KB |
Output is correct |
19 |
Correct |
8 ms |
8528 KB |
Output is correct |
20 |
Correct |
12 ms |
8636 KB |
Output is correct |
21 |
Correct |
9 ms |
8624 KB |
Output is correct |
22 |
Correct |
8 ms |
8564 KB |
Output is correct |
23 |
Correct |
150 ms |
10836 KB |
Output is correct |
24 |
Correct |
57 ms |
9856 KB |
Output is correct |
25 |
Correct |
165 ms |
10852 KB |
Output is correct |
26 |
Correct |
231 ms |
11784 KB |
Output is correct |
27 |
Correct |
191 ms |
11088 KB |
Output is correct |
28 |
Correct |
90 ms |
9932 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
8276 KB |
Output is correct |
2 |
Correct |
3 ms |
8276 KB |
Output is correct |
3 |
Correct |
3 ms |
8276 KB |
Output is correct |
4 |
Correct |
4 ms |
8276 KB |
Output is correct |
5 |
Correct |
447 ms |
11644 KB |
Output is correct |
6 |
Correct |
484 ms |
12648 KB |
Output is correct |
7 |
Correct |
104 ms |
9852 KB |
Output is correct |
8 |
Correct |
460 ms |
11524 KB |
Output is correct |
9 |
Correct |
842 ms |
14712 KB |
Output is correct |
10 |
Correct |
8 ms |
8660 KB |
Output is correct |
11 |
Correct |
7 ms |
8564 KB |
Output is correct |
12 |
Correct |
5 ms |
8276 KB |
Output is correct |
13 |
Correct |
20 ms |
8864 KB |
Output is correct |
14 |
Correct |
7 ms |
8512 KB |
Output is correct |
15 |
Correct |
23 ms |
8936 KB |
Output is correct |
16 |
Correct |
31 ms |
8996 KB |
Output is correct |
17 |
Correct |
19 ms |
8680 KB |
Output is correct |
18 |
Correct |
4 ms |
8404 KB |
Output is correct |
19 |
Correct |
4 ms |
8404 KB |
Output is correct |
20 |
Correct |
7 ms |
8532 KB |
Output is correct |
21 |
Correct |
12 ms |
8636 KB |
Output is correct |
22 |
Correct |
4 ms |
8276 KB |
Output is correct |
23 |
Correct |
4 ms |
8276 KB |
Output is correct |
24 |
Correct |
4 ms |
8276 KB |
Output is correct |
25 |
Correct |
5 ms |
8276 KB |
Output is correct |
26 |
Correct |
21 ms |
8860 KB |
Output is correct |
27 |
Correct |
7 ms |
8512 KB |
Output is correct |
28 |
Correct |
28 ms |
8924 KB |
Output is correct |
29 |
Correct |
37 ms |
9012 KB |
Output is correct |
30 |
Correct |
18 ms |
8720 KB |
Output is correct |
31 |
Correct |
5 ms |
8456 KB |
Output is correct |
32 |
Correct |
4 ms |
8404 KB |
Output is correct |
33 |
Correct |
7 ms |
8532 KB |
Output is correct |
34 |
Correct |
12 ms |
8636 KB |
Output is correct |
35 |
Correct |
75 ms |
9556 KB |
Output is correct |
36 |
Correct |
20 ms |
8904 KB |
Output is correct |
37 |
Correct |
115 ms |
9524 KB |
Output is correct |
38 |
Correct |
74 ms |
9492 KB |
Output is correct |
39 |
Correct |
94 ms |
9308 KB |
Output is correct |
40 |
Correct |
4 ms |
8276 KB |
Output is correct |
41 |
Correct |
20 ms |
8860 KB |
Output is correct |
42 |
Correct |
8 ms |
8512 KB |
Output is correct |
43 |
Correct |
22 ms |
8924 KB |
Output is correct |
44 |
Correct |
37 ms |
9096 KB |
Output is correct |
45 |
Correct |
19 ms |
8668 KB |
Output is correct |
46 |
Correct |
5 ms |
8404 KB |
Output is correct |
47 |
Correct |
5 ms |
8404 KB |
Output is correct |
48 |
Correct |
8 ms |
8528 KB |
Output is correct |
49 |
Correct |
12 ms |
8636 KB |
Output is correct |
50 |
Correct |
9 ms |
8624 KB |
Output is correct |
51 |
Correct |
8 ms |
8564 KB |
Output is correct |
52 |
Correct |
150 ms |
10836 KB |
Output is correct |
53 |
Correct |
57 ms |
9856 KB |
Output is correct |
54 |
Correct |
165 ms |
10852 KB |
Output is correct |
55 |
Correct |
231 ms |
11784 KB |
Output is correct |
56 |
Correct |
191 ms |
11088 KB |
Output is correct |
57 |
Correct |
90 ms |
9932 KB |
Output is correct |
58 |
Correct |
4 ms |
8276 KB |
Output is correct |
59 |
Correct |
3 ms |
8276 KB |
Output is correct |
60 |
Correct |
4 ms |
8276 KB |
Output is correct |
61 |
Correct |
6 ms |
8276 KB |
Output is correct |
62 |
Correct |
440 ms |
11660 KB |
Output is correct |
63 |
Correct |
467 ms |
12640 KB |
Output is correct |
64 |
Correct |
114 ms |
9924 KB |
Output is correct |
65 |
Correct |
430 ms |
11600 KB |
Output is correct |
66 |
Correct |
836 ms |
14684 KB |
Output is correct |
67 |
Correct |
8 ms |
8644 KB |
Output is correct |
68 |
Correct |
7 ms |
8564 KB |
Output is correct |
69 |
Correct |
22 ms |
8860 KB |
Output is correct |
70 |
Correct |
6 ms |
8496 KB |
Output is correct |
71 |
Correct |
22 ms |
8904 KB |
Output is correct |
72 |
Correct |
30 ms |
8980 KB |
Output is correct |
73 |
Correct |
18 ms |
8700 KB |
Output is correct |
74 |
Correct |
5 ms |
8404 KB |
Output is correct |
75 |
Correct |
4 ms |
8404 KB |
Output is correct |
76 |
Correct |
10 ms |
8508 KB |
Output is correct |
77 |
Correct |
12 ms |
8636 KB |
Output is correct |
78 |
Correct |
88 ms |
9556 KB |
Output is correct |
79 |
Correct |
23 ms |
8916 KB |
Output is correct |
80 |
Correct |
106 ms |
9516 KB |
Output is correct |
81 |
Correct |
70 ms |
9660 KB |
Output is correct |
82 |
Correct |
75 ms |
9328 KB |
Output is correct |
83 |
Correct |
156 ms |
10824 KB |
Output is correct |
84 |
Correct |
71 ms |
9968 KB |
Output is correct |
85 |
Correct |
176 ms |
10868 KB |
Output is correct |
86 |
Correct |
276 ms |
11800 KB |
Output is correct |
87 |
Correct |
198 ms |
11072 KB |
Output is correct |
88 |
Correct |
89 ms |
10008 KB |
Output is correct |
89 |
Correct |
610 ms |
13220 KB |
Output is correct |
90 |
Correct |
872 ms |
14544 KB |
Output is correct |
91 |
Correct |
620 ms |
13040 KB |
Output is correct |
92 |
Correct |
627 ms |
13528 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
8276 KB |
Output is correct |
2 |
Correct |
20 ms |
8864 KB |
Output is correct |
3 |
Correct |
7 ms |
8512 KB |
Output is correct |
4 |
Correct |
23 ms |
8936 KB |
Output is correct |
5 |
Correct |
31 ms |
8996 KB |
Output is correct |
6 |
Correct |
19 ms |
8680 KB |
Output is correct |
7 |
Correct |
4 ms |
8404 KB |
Output is correct |
8 |
Correct |
4 ms |
8404 KB |
Output is correct |
9 |
Correct |
7 ms |
8532 KB |
Output is correct |
10 |
Correct |
12 ms |
8636 KB |
Output is correct |
11 |
Correct |
4 ms |
8276 KB |
Output is correct |
12 |
Correct |
20 ms |
8860 KB |
Output is correct |
13 |
Correct |
8 ms |
8512 KB |
Output is correct |
14 |
Correct |
22 ms |
8924 KB |
Output is correct |
15 |
Correct |
37 ms |
9096 KB |
Output is correct |
16 |
Correct |
19 ms |
8668 KB |
Output is correct |
17 |
Correct |
5 ms |
8404 KB |
Output is correct |
18 |
Correct |
5 ms |
8404 KB |
Output is correct |
19 |
Correct |
8 ms |
8528 KB |
Output is correct |
20 |
Correct |
12 ms |
8636 KB |
Output is correct |
21 |
Correct |
9 ms |
8624 KB |
Output is correct |
22 |
Correct |
8 ms |
8564 KB |
Output is correct |
23 |
Correct |
150 ms |
10836 KB |
Output is correct |
24 |
Correct |
57 ms |
9856 KB |
Output is correct |
25 |
Correct |
165 ms |
10852 KB |
Output is correct |
26 |
Correct |
231 ms |
11784 KB |
Output is correct |
27 |
Correct |
191 ms |
11088 KB |
Output is correct |
28 |
Correct |
90 ms |
9932 KB |
Output is correct |
29 |
Correct |
4 ms |
8276 KB |
Output is correct |
30 |
Correct |
28 ms |
8824 KB |
Output is correct |
31 |
Correct |
7 ms |
8512 KB |
Output is correct |
32 |
Correct |
23 ms |
8892 KB |
Output is correct |
33 |
Correct |
31 ms |
9004 KB |
Output is correct |
34 |
Correct |
23 ms |
8740 KB |
Output is correct |
35 |
Correct |
4 ms |
8404 KB |
Output is correct |
36 |
Correct |
4 ms |
8404 KB |
Output is correct |
37 |
Correct |
7 ms |
8504 KB |
Output is correct |
38 |
Correct |
13 ms |
8668 KB |
Output is correct |
39 |
Correct |
8 ms |
8676 KB |
Output is correct |
40 |
Correct |
7 ms |
8564 KB |
Output is correct |
41 |
Correct |
160 ms |
10880 KB |
Output is correct |
42 |
Correct |
60 ms |
9844 KB |
Output is correct |
43 |
Correct |
154 ms |
10852 KB |
Output is correct |
44 |
Correct |
236 ms |
11908 KB |
Output is correct |
45 |
Correct |
185 ms |
11140 KB |
Output is correct |
46 |
Correct |
92 ms |
9952 KB |
Output is correct |
47 |
Correct |
39 ms |
9748 KB |
Output is correct |
48 |
Correct |
37 ms |
9604 KB |
Output is correct |
49 |
Correct |
2751 ms |
30100 KB |
Output is correct |
50 |
Correct |
776 ms |
19288 KB |
Output is correct |
51 |
Correct |
3092 ms |
32804 KB |
Output is correct |
52 |
Correct |
4267 ms |
39780 KB |
Output is correct |
53 |
Correct |
2651 ms |
29972 KB |
Output is correct |
54 |
Correct |
1699 ms |
22624 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
8276 KB |
Output is correct |
2 |
Correct |
3 ms |
8276 KB |
Output is correct |
3 |
Correct |
3 ms |
8276 KB |
Output is correct |
4 |
Correct |
4 ms |
8276 KB |
Output is correct |
5 |
Correct |
447 ms |
11644 KB |
Output is correct |
6 |
Correct |
484 ms |
12648 KB |
Output is correct |
7 |
Correct |
104 ms |
9852 KB |
Output is correct |
8 |
Correct |
460 ms |
11524 KB |
Output is correct |
9 |
Correct |
842 ms |
14712 KB |
Output is correct |
10 |
Correct |
8 ms |
8660 KB |
Output is correct |
11 |
Correct |
7 ms |
8564 KB |
Output is correct |
12 |
Correct |
4 ms |
8276 KB |
Output is correct |
13 |
Correct |
3 ms |
8276 KB |
Output is correct |
14 |
Correct |
3 ms |
8276 KB |
Output is correct |
15 |
Correct |
4 ms |
8276 KB |
Output is correct |
16 |
Correct |
440 ms |
11692 KB |
Output is correct |
17 |
Correct |
446 ms |
12796 KB |
Output is correct |
18 |
Correct |
102 ms |
9872 KB |
Output is correct |
19 |
Correct |
414 ms |
11596 KB |
Output is correct |
20 |
Correct |
824 ms |
14632 KB |
Output is correct |
21 |
Correct |
9 ms |
8644 KB |
Output is correct |
22 |
Correct |
8 ms |
8564 KB |
Output is correct |
23 |
Execution timed out |
5059 ms |
38004 KB |
Time limit exceeded |
24 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
8276 KB |
Output is correct |
2 |
Correct |
20 ms |
8864 KB |
Output is correct |
3 |
Correct |
7 ms |
8512 KB |
Output is correct |
4 |
Correct |
23 ms |
8936 KB |
Output is correct |
5 |
Correct |
31 ms |
8996 KB |
Output is correct |
6 |
Correct |
19 ms |
8680 KB |
Output is correct |
7 |
Correct |
4 ms |
8404 KB |
Output is correct |
8 |
Correct |
4 ms |
8404 KB |
Output is correct |
9 |
Correct |
7 ms |
8532 KB |
Output is correct |
10 |
Correct |
12 ms |
8636 KB |
Output is correct |
11 |
Correct |
4 ms |
8276 KB |
Output is correct |
12 |
Correct |
20 ms |
8860 KB |
Output is correct |
13 |
Correct |
8 ms |
8512 KB |
Output is correct |
14 |
Correct |
22 ms |
8924 KB |
Output is correct |
15 |
Correct |
37 ms |
9096 KB |
Output is correct |
16 |
Correct |
19 ms |
8668 KB |
Output is correct |
17 |
Correct |
5 ms |
8404 KB |
Output is correct |
18 |
Correct |
5 ms |
8404 KB |
Output is correct |
19 |
Correct |
8 ms |
8528 KB |
Output is correct |
20 |
Correct |
12 ms |
8636 KB |
Output is correct |
21 |
Correct |
9 ms |
8624 KB |
Output is correct |
22 |
Correct |
8 ms |
8564 KB |
Output is correct |
23 |
Correct |
150 ms |
10836 KB |
Output is correct |
24 |
Correct |
57 ms |
9856 KB |
Output is correct |
25 |
Correct |
165 ms |
10852 KB |
Output is correct |
26 |
Correct |
231 ms |
11784 KB |
Output is correct |
27 |
Correct |
191 ms |
11088 KB |
Output is correct |
28 |
Correct |
90 ms |
9932 KB |
Output is correct |
29 |
Correct |
4 ms |
8276 KB |
Output is correct |
30 |
Correct |
28 ms |
8824 KB |
Output is correct |
31 |
Correct |
7 ms |
8512 KB |
Output is correct |
32 |
Correct |
23 ms |
8892 KB |
Output is correct |
33 |
Correct |
31 ms |
9004 KB |
Output is correct |
34 |
Correct |
23 ms |
8740 KB |
Output is correct |
35 |
Correct |
4 ms |
8404 KB |
Output is correct |
36 |
Correct |
4 ms |
8404 KB |
Output is correct |
37 |
Correct |
7 ms |
8504 KB |
Output is correct |
38 |
Correct |
13 ms |
8668 KB |
Output is correct |
39 |
Correct |
8 ms |
8676 KB |
Output is correct |
40 |
Correct |
7 ms |
8564 KB |
Output is correct |
41 |
Correct |
160 ms |
10880 KB |
Output is correct |
42 |
Correct |
60 ms |
9844 KB |
Output is correct |
43 |
Correct |
154 ms |
10852 KB |
Output is correct |
44 |
Correct |
236 ms |
11908 KB |
Output is correct |
45 |
Correct |
185 ms |
11140 KB |
Output is correct |
46 |
Correct |
92 ms |
9952 KB |
Output is correct |
47 |
Correct |
39 ms |
9748 KB |
Output is correct |
48 |
Correct |
37 ms |
9604 KB |
Output is correct |
49 |
Correct |
2751 ms |
30100 KB |
Output is correct |
50 |
Correct |
776 ms |
19288 KB |
Output is correct |
51 |
Correct |
3092 ms |
32804 KB |
Output is correct |
52 |
Correct |
4267 ms |
39780 KB |
Output is correct |
53 |
Correct |
2651 ms |
29972 KB |
Output is correct |
54 |
Correct |
1699 ms |
22624 KB |
Output is correct |
55 |
Correct |
4 ms |
8276 KB |
Output is correct |
56 |
Correct |
22 ms |
8848 KB |
Output is correct |
57 |
Correct |
7 ms |
8512 KB |
Output is correct |
58 |
Correct |
22 ms |
8892 KB |
Output is correct |
59 |
Correct |
30 ms |
9040 KB |
Output is correct |
60 |
Correct |
19 ms |
8844 KB |
Output is correct |
61 |
Correct |
5 ms |
8364 KB |
Output is correct |
62 |
Correct |
4 ms |
8404 KB |
Output is correct |
63 |
Correct |
7 ms |
8532 KB |
Output is correct |
64 |
Correct |
12 ms |
8628 KB |
Output is correct |
65 |
Correct |
9 ms |
8652 KB |
Output is correct |
66 |
Correct |
7 ms |
8564 KB |
Output is correct |
67 |
Correct |
154 ms |
10820 KB |
Output is correct |
68 |
Correct |
61 ms |
9828 KB |
Output is correct |
69 |
Correct |
151 ms |
10980 KB |
Output is correct |
70 |
Correct |
228 ms |
11824 KB |
Output is correct |
71 |
Correct |
171 ms |
11088 KB |
Output is correct |
72 |
Correct |
90 ms |
9988 KB |
Output is correct |
73 |
Correct |
39 ms |
9808 KB |
Output is correct |
74 |
Correct |
40 ms |
9616 KB |
Output is correct |
75 |
Correct |
2744 ms |
30132 KB |
Output is correct |
76 |
Correct |
784 ms |
19324 KB |
Output is correct |
77 |
Correct |
3206 ms |
32788 KB |
Output is correct |
78 |
Correct |
4268 ms |
39900 KB |
Output is correct |
79 |
Correct |
2743 ms |
29876 KB |
Output is correct |
80 |
Correct |
1672 ms |
22632 KB |
Output is correct |
81 |
Runtime error |
10 ms |
16692 KB |
Execution killed with signal 11 |
82 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
8276 KB |
Output is correct |
2 |
Correct |
3 ms |
8276 KB |
Output is correct |
3 |
Correct |
3 ms |
8276 KB |
Output is correct |
4 |
Correct |
4 ms |
8276 KB |
Output is correct |
5 |
Correct |
447 ms |
11644 KB |
Output is correct |
6 |
Correct |
484 ms |
12648 KB |
Output is correct |
7 |
Correct |
104 ms |
9852 KB |
Output is correct |
8 |
Correct |
460 ms |
11524 KB |
Output is correct |
9 |
Correct |
842 ms |
14712 KB |
Output is correct |
10 |
Correct |
8 ms |
8660 KB |
Output is correct |
11 |
Correct |
7 ms |
8564 KB |
Output is correct |
12 |
Correct |
4 ms |
8276 KB |
Output is correct |
13 |
Correct |
3 ms |
8276 KB |
Output is correct |
14 |
Correct |
3 ms |
8276 KB |
Output is correct |
15 |
Correct |
4 ms |
8276 KB |
Output is correct |
16 |
Correct |
440 ms |
11692 KB |
Output is correct |
17 |
Correct |
446 ms |
12796 KB |
Output is correct |
18 |
Correct |
102 ms |
9872 KB |
Output is correct |
19 |
Correct |
414 ms |
11596 KB |
Output is correct |
20 |
Correct |
824 ms |
14632 KB |
Output is correct |
21 |
Correct |
9 ms |
8644 KB |
Output is correct |
22 |
Correct |
8 ms |
8564 KB |
Output is correct |
23 |
Execution timed out |
5059 ms |
38004 KB |
Time limit exceeded |
24 |
Halted |
0 ms |
0 KB |
- |