#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];
llo dp[2000001];
deque<pair<llo,llo>> 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){
for(llo 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()){
llo xx=zz[y].front().a-z;
if(dp[ii]==-1){
dp[ii]=xx;
}
dp[ii]=min(dp[ii],xx);
}
/*y++;
if(y==j){
y=0;
z++;
}*/
}
}
else{
//llo y=0;
//llo z=0;
for(llo ii=su5;ii<=su3;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-ax){
zz[y].pop_front();
}
else{
break;
}
}
if(zz[y].size()){
llo xx=zz[y].front().a+z;
if(dp[ii]==-1){
dp[ii]=xx;
}
dp[ii]=min(dp[ii],xx);
}
}
}
//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;
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(r==4){
cout<<(j-n*n*n)<<"::"<<endl;
}*/
/*if(r==6){
cout<<(j-n*n*n)<<","<<endl;
}*/
//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=abs(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;
}
// cout<<(j-n*n*n)<<":"<<r<<":"<<pp<<":"<<cur2<<",,"<<x<<endl;
//cout<<cur2-j<<",,,"<<(i-n)<<",,"<<cc[4]<<endl;
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);
/*for(llo i=1;i<=n;i++){
llo su2=0;
llo ac=0;
for(llo j=i+1;j<=n;j++){
llo xx=it[j]-n;
if(xx<0){
xx=0;
}
ac+=xx;
su2+=xx*j;
}
if(su2>cur){
continue;
}
llo su3=0;//n*n*n;
for(llo j=1;j<i;j++){
su3+=j*min(it[j],i);
}
for(llo j=i+1;j<=n;j++){
su3+=j*min(it[j],n);
}
for(llo j=0;j<=su3;j++){
dp[j]=-1;
}
dp[0]=0;
su3=0;
for(llo j=1;j<=n;j++){
if(j==i){
continue;
}
if(j<i){
su3+=j*min(it[j],i);
}
else{
su3+=j*min(it[j],n);
}
for(llo jj=0;jj<j;jj++){
zz[jj].clear();
}
llo ax=j*min(it[j],n);
llo y=0;
llo z=0;
for(llo ii=0;ii<=su3;ii++){
// llo y=ii%j;
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-ax){
zz[y].pop_front();
}
else{
break;
}
}
if(zz[y].size()){
llo xx=zz[y].front().a+z;
if(dp[ii]==-1){
dp[ii]=xx;
}
dp[ii]=min(dp[ii],xx);
}
y++;
if(y==j){
y=0;
z++;
}
}
}
llo cur2=cur-su2;
for(llo j=cur2%i;j<=su3 and j<=cur2;j+=i){
if(dp[j]>=0){
//if((cur2-j)%i==0){
llo x=(cur2-j)/i;
if(x<=it[i]){
llo y=dp[j]+x;
y+=ac;
if(ans==-1){
ans=y;
}
ans=min(ans,y);
}
//}
}
}
}*/
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 |
7 ms |
16084 KB |
Output is correct |
2 |
Correct |
7 ms |
16176 KB |
Output is correct |
3 |
Correct |
6 ms |
16084 KB |
Output is correct |
4 |
Correct |
7 ms |
16084 KB |
Output is correct |
5 |
Correct |
752 ms |
19532 KB |
Output is correct |
6 |
Correct |
729 ms |
20512 KB |
Output is correct |
7 |
Correct |
314 ms |
17680 KB |
Output is correct |
8 |
Correct |
680 ms |
19692 KB |
Output is correct |
9 |
Correct |
1330 ms |
22592 KB |
Output is correct |
10 |
Correct |
47 ms |
16488 KB |
Output is correct |
11 |
Correct |
40 ms |
16384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
16084 KB |
Output is correct |
2 |
Correct |
7 ms |
16176 KB |
Output is correct |
3 |
Correct |
6 ms |
16084 KB |
Output is correct |
4 |
Correct |
7 ms |
16084 KB |
Output is correct |
5 |
Correct |
752 ms |
19532 KB |
Output is correct |
6 |
Correct |
729 ms |
20512 KB |
Output is correct |
7 |
Correct |
314 ms |
17680 KB |
Output is correct |
8 |
Correct |
680 ms |
19692 KB |
Output is correct |
9 |
Correct |
1330 ms |
22592 KB |
Output is correct |
10 |
Correct |
47 ms |
16488 KB |
Output is correct |
11 |
Correct |
40 ms |
16384 KB |
Output is correct |
12 |
Correct |
8 ms |
16084 KB |
Output is correct |
13 |
Correct |
7 ms |
16084 KB |
Output is correct |
14 |
Correct |
7 ms |
16084 KB |
Output is correct |
15 |
Correct |
7 ms |
16084 KB |
Output is correct |
16 |
Correct |
751 ms |
19524 KB |
Output is correct |
17 |
Correct |
715 ms |
20516 KB |
Output is correct |
18 |
Correct |
314 ms |
17768 KB |
Output is correct |
19 |
Correct |
657 ms |
19544 KB |
Output is correct |
20 |
Correct |
1313 ms |
22636 KB |
Output is correct |
21 |
Correct |
43 ms |
16488 KB |
Output is correct |
22 |
Correct |
41 ms |
16380 KB |
Output is correct |
23 |
Execution timed out |
5052 ms |
45540 KB |
Time limit exceeded |
24 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
16084 KB |
Output is correct |
2 |
Correct |
55 ms |
16660 KB |
Output is correct |
3 |
Correct |
24 ms |
16332 KB |
Output is correct |
4 |
Correct |
62 ms |
16736 KB |
Output is correct |
5 |
Correct |
87 ms |
16852 KB |
Output is correct |
6 |
Correct |
53 ms |
16612 KB |
Output is correct |
7 |
Correct |
14 ms |
16268 KB |
Output is correct |
8 |
Correct |
14 ms |
16248 KB |
Output is correct |
9 |
Correct |
22 ms |
16340 KB |
Output is correct |
10 |
Correct |
39 ms |
16484 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
16084 KB |
Output is correct |
2 |
Correct |
55 ms |
16660 KB |
Output is correct |
3 |
Correct |
24 ms |
16332 KB |
Output is correct |
4 |
Correct |
62 ms |
16736 KB |
Output is correct |
5 |
Correct |
87 ms |
16852 KB |
Output is correct |
6 |
Correct |
53 ms |
16612 KB |
Output is correct |
7 |
Correct |
14 ms |
16268 KB |
Output is correct |
8 |
Correct |
14 ms |
16248 KB |
Output is correct |
9 |
Correct |
22 ms |
16340 KB |
Output is correct |
10 |
Correct |
39 ms |
16484 KB |
Output is correct |
11 |
Correct |
7 ms |
16084 KB |
Output is correct |
12 |
Correct |
7 ms |
16084 KB |
Output is correct |
13 |
Correct |
8 ms |
16084 KB |
Output is correct |
14 |
Correct |
7 ms |
16084 KB |
Output is correct |
15 |
Correct |
53 ms |
16648 KB |
Output is correct |
16 |
Correct |
26 ms |
16332 KB |
Output is correct |
17 |
Correct |
64 ms |
16772 KB |
Output is correct |
18 |
Correct |
83 ms |
16844 KB |
Output is correct |
19 |
Correct |
54 ms |
16544 KB |
Output is correct |
20 |
Correct |
17 ms |
16212 KB |
Output is correct |
21 |
Correct |
15 ms |
16244 KB |
Output is correct |
22 |
Correct |
22 ms |
16340 KB |
Output is correct |
23 |
Correct |
34 ms |
16440 KB |
Output is correct |
24 |
Correct |
113 ms |
17364 KB |
Output is correct |
25 |
Correct |
57 ms |
16704 KB |
Output is correct |
26 |
Correct |
180 ms |
17340 KB |
Output is correct |
27 |
Correct |
115 ms |
17336 KB |
Output is correct |
28 |
Correct |
123 ms |
17160 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
16084 KB |
Output is correct |
2 |
Correct |
55 ms |
16660 KB |
Output is correct |
3 |
Correct |
24 ms |
16332 KB |
Output is correct |
4 |
Correct |
62 ms |
16736 KB |
Output is correct |
5 |
Correct |
87 ms |
16852 KB |
Output is correct |
6 |
Correct |
53 ms |
16612 KB |
Output is correct |
7 |
Correct |
14 ms |
16268 KB |
Output is correct |
8 |
Correct |
14 ms |
16248 KB |
Output is correct |
9 |
Correct |
22 ms |
16340 KB |
Output is correct |
10 |
Correct |
39 ms |
16484 KB |
Output is correct |
11 |
Correct |
7 ms |
16084 KB |
Output is correct |
12 |
Correct |
61 ms |
16664 KB |
Output is correct |
13 |
Correct |
25 ms |
16340 KB |
Output is correct |
14 |
Correct |
64 ms |
16748 KB |
Output is correct |
15 |
Correct |
82 ms |
16804 KB |
Output is correct |
16 |
Correct |
51 ms |
16568 KB |
Output is correct |
17 |
Correct |
17 ms |
16212 KB |
Output is correct |
18 |
Correct |
14 ms |
16212 KB |
Output is correct |
19 |
Correct |
23 ms |
16340 KB |
Output is correct |
20 |
Correct |
38 ms |
16476 KB |
Output is correct |
21 |
Correct |
43 ms |
16448 KB |
Output is correct |
22 |
Correct |
40 ms |
16364 KB |
Output is correct |
23 |
Correct |
449 ms |
18656 KB |
Output is correct |
24 |
Correct |
295 ms |
17676 KB |
Output is correct |
25 |
Correct |
461 ms |
18832 KB |
Output is correct |
26 |
Correct |
685 ms |
19796 KB |
Output is correct |
27 |
Correct |
528 ms |
18956 KB |
Output is correct |
28 |
Correct |
306 ms |
17768 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
16084 KB |
Output is correct |
2 |
Correct |
7 ms |
16176 KB |
Output is correct |
3 |
Correct |
6 ms |
16084 KB |
Output is correct |
4 |
Correct |
7 ms |
16084 KB |
Output is correct |
5 |
Correct |
752 ms |
19532 KB |
Output is correct |
6 |
Correct |
729 ms |
20512 KB |
Output is correct |
7 |
Correct |
314 ms |
17680 KB |
Output is correct |
8 |
Correct |
680 ms |
19692 KB |
Output is correct |
9 |
Correct |
1330 ms |
22592 KB |
Output is correct |
10 |
Correct |
47 ms |
16488 KB |
Output is correct |
11 |
Correct |
40 ms |
16384 KB |
Output is correct |
12 |
Correct |
7 ms |
16084 KB |
Output is correct |
13 |
Correct |
55 ms |
16660 KB |
Output is correct |
14 |
Correct |
24 ms |
16332 KB |
Output is correct |
15 |
Correct |
62 ms |
16736 KB |
Output is correct |
16 |
Correct |
87 ms |
16852 KB |
Output is correct |
17 |
Correct |
53 ms |
16612 KB |
Output is correct |
18 |
Correct |
14 ms |
16268 KB |
Output is correct |
19 |
Correct |
14 ms |
16248 KB |
Output is correct |
20 |
Correct |
22 ms |
16340 KB |
Output is correct |
21 |
Correct |
39 ms |
16484 KB |
Output is correct |
22 |
Correct |
7 ms |
16084 KB |
Output is correct |
23 |
Correct |
7 ms |
16084 KB |
Output is correct |
24 |
Correct |
8 ms |
16084 KB |
Output is correct |
25 |
Correct |
7 ms |
16084 KB |
Output is correct |
26 |
Correct |
53 ms |
16648 KB |
Output is correct |
27 |
Correct |
26 ms |
16332 KB |
Output is correct |
28 |
Correct |
64 ms |
16772 KB |
Output is correct |
29 |
Correct |
83 ms |
16844 KB |
Output is correct |
30 |
Correct |
54 ms |
16544 KB |
Output is correct |
31 |
Correct |
17 ms |
16212 KB |
Output is correct |
32 |
Correct |
15 ms |
16244 KB |
Output is correct |
33 |
Correct |
22 ms |
16340 KB |
Output is correct |
34 |
Correct |
34 ms |
16440 KB |
Output is correct |
35 |
Correct |
113 ms |
17364 KB |
Output is correct |
36 |
Correct |
57 ms |
16704 KB |
Output is correct |
37 |
Correct |
180 ms |
17340 KB |
Output is correct |
38 |
Correct |
115 ms |
17336 KB |
Output is correct |
39 |
Correct |
123 ms |
17160 KB |
Output is correct |
40 |
Correct |
7 ms |
16084 KB |
Output is correct |
41 |
Correct |
61 ms |
16664 KB |
Output is correct |
42 |
Correct |
25 ms |
16340 KB |
Output is correct |
43 |
Correct |
64 ms |
16748 KB |
Output is correct |
44 |
Correct |
82 ms |
16804 KB |
Output is correct |
45 |
Correct |
51 ms |
16568 KB |
Output is correct |
46 |
Correct |
17 ms |
16212 KB |
Output is correct |
47 |
Correct |
14 ms |
16212 KB |
Output is correct |
48 |
Correct |
23 ms |
16340 KB |
Output is correct |
49 |
Correct |
38 ms |
16476 KB |
Output is correct |
50 |
Correct |
43 ms |
16448 KB |
Output is correct |
51 |
Correct |
40 ms |
16364 KB |
Output is correct |
52 |
Correct |
449 ms |
18656 KB |
Output is correct |
53 |
Correct |
295 ms |
17676 KB |
Output is correct |
54 |
Correct |
461 ms |
18832 KB |
Output is correct |
55 |
Correct |
685 ms |
19796 KB |
Output is correct |
56 |
Correct |
528 ms |
18956 KB |
Output is correct |
57 |
Correct |
306 ms |
17768 KB |
Output is correct |
58 |
Correct |
7 ms |
16148 KB |
Output is correct |
59 |
Correct |
7 ms |
16084 KB |
Output is correct |
60 |
Correct |
7 ms |
16084 KB |
Output is correct |
61 |
Correct |
7 ms |
16084 KB |
Output is correct |
62 |
Correct |
792 ms |
19500 KB |
Output is correct |
63 |
Correct |
732 ms |
20448 KB |
Output is correct |
64 |
Correct |
303 ms |
17708 KB |
Output is correct |
65 |
Correct |
704 ms |
19544 KB |
Output is correct |
66 |
Correct |
1323 ms |
22580 KB |
Output is correct |
67 |
Correct |
46 ms |
16476 KB |
Output is correct |
68 |
Correct |
47 ms |
16360 KB |
Output is correct |
69 |
Correct |
53 ms |
16664 KB |
Output is correct |
70 |
Correct |
27 ms |
16352 KB |
Output is correct |
71 |
Correct |
60 ms |
16756 KB |
Output is correct |
72 |
Correct |
86 ms |
16840 KB |
Output is correct |
73 |
Correct |
50 ms |
16528 KB |
Output is correct |
74 |
Correct |
14 ms |
16212 KB |
Output is correct |
75 |
Correct |
13 ms |
16212 KB |
Output is correct |
76 |
Correct |
22 ms |
16340 KB |
Output is correct |
77 |
Correct |
37 ms |
16440 KB |
Output is correct |
78 |
Correct |
116 ms |
17400 KB |
Output is correct |
79 |
Correct |
62 ms |
16668 KB |
Output is correct |
80 |
Correct |
162 ms |
17356 KB |
Output is correct |
81 |
Correct |
114 ms |
17320 KB |
Output is correct |
82 |
Correct |
122 ms |
17160 KB |
Output is correct |
83 |
Correct |
448 ms |
18656 KB |
Output is correct |
84 |
Correct |
309 ms |
17792 KB |
Output is correct |
85 |
Correct |
461 ms |
18764 KB |
Output is correct |
86 |
Correct |
683 ms |
19688 KB |
Output is correct |
87 |
Correct |
511 ms |
18988 KB |
Output is correct |
88 |
Correct |
306 ms |
17916 KB |
Output is correct |
89 |
Correct |
934 ms |
20940 KB |
Output is correct |
90 |
Correct |
1393 ms |
22572 KB |
Output is correct |
91 |
Correct |
962 ms |
21436 KB |
Output is correct |
92 |
Correct |
1061 ms |
21264 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
16084 KB |
Output is correct |
2 |
Correct |
55 ms |
16660 KB |
Output is correct |
3 |
Correct |
24 ms |
16332 KB |
Output is correct |
4 |
Correct |
62 ms |
16736 KB |
Output is correct |
5 |
Correct |
87 ms |
16852 KB |
Output is correct |
6 |
Correct |
53 ms |
16612 KB |
Output is correct |
7 |
Correct |
14 ms |
16268 KB |
Output is correct |
8 |
Correct |
14 ms |
16248 KB |
Output is correct |
9 |
Correct |
22 ms |
16340 KB |
Output is correct |
10 |
Correct |
39 ms |
16484 KB |
Output is correct |
11 |
Correct |
7 ms |
16084 KB |
Output is correct |
12 |
Correct |
61 ms |
16664 KB |
Output is correct |
13 |
Correct |
25 ms |
16340 KB |
Output is correct |
14 |
Correct |
64 ms |
16748 KB |
Output is correct |
15 |
Correct |
82 ms |
16804 KB |
Output is correct |
16 |
Correct |
51 ms |
16568 KB |
Output is correct |
17 |
Correct |
17 ms |
16212 KB |
Output is correct |
18 |
Correct |
14 ms |
16212 KB |
Output is correct |
19 |
Correct |
23 ms |
16340 KB |
Output is correct |
20 |
Correct |
38 ms |
16476 KB |
Output is correct |
21 |
Correct |
43 ms |
16448 KB |
Output is correct |
22 |
Correct |
40 ms |
16364 KB |
Output is correct |
23 |
Correct |
449 ms |
18656 KB |
Output is correct |
24 |
Correct |
295 ms |
17676 KB |
Output is correct |
25 |
Correct |
461 ms |
18832 KB |
Output is correct |
26 |
Correct |
685 ms |
19796 KB |
Output is correct |
27 |
Correct |
528 ms |
18956 KB |
Output is correct |
28 |
Correct |
306 ms |
17768 KB |
Output is correct |
29 |
Correct |
7 ms |
16084 KB |
Output is correct |
30 |
Correct |
62 ms |
16652 KB |
Output is correct |
31 |
Correct |
26 ms |
16272 KB |
Output is correct |
32 |
Correct |
60 ms |
16752 KB |
Output is correct |
33 |
Correct |
81 ms |
16844 KB |
Output is correct |
34 |
Correct |
50 ms |
16560 KB |
Output is correct |
35 |
Correct |
15 ms |
16272 KB |
Output is correct |
36 |
Correct |
13 ms |
16212 KB |
Output is correct |
37 |
Correct |
23 ms |
16276 KB |
Output is correct |
38 |
Correct |
37 ms |
16472 KB |
Output is correct |
39 |
Correct |
42 ms |
16464 KB |
Output is correct |
40 |
Correct |
43 ms |
16308 KB |
Output is correct |
41 |
Correct |
448 ms |
18656 KB |
Output is correct |
42 |
Correct |
301 ms |
17744 KB |
Output is correct |
43 |
Correct |
460 ms |
18660 KB |
Output is correct |
44 |
Correct |
669 ms |
19624 KB |
Output is correct |
45 |
Correct |
511 ms |
19004 KB |
Output is correct |
46 |
Correct |
312 ms |
17876 KB |
Output is correct |
47 |
Correct |
354 ms |
17628 KB |
Output is correct |
48 |
Correct |
382 ms |
17556 KB |
Output is correct |
49 |
Execution timed out |
5049 ms |
37860 KB |
Time limit exceeded |
50 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
16084 KB |
Output is correct |
2 |
Correct |
7 ms |
16176 KB |
Output is correct |
3 |
Correct |
6 ms |
16084 KB |
Output is correct |
4 |
Correct |
7 ms |
16084 KB |
Output is correct |
5 |
Correct |
752 ms |
19532 KB |
Output is correct |
6 |
Correct |
729 ms |
20512 KB |
Output is correct |
7 |
Correct |
314 ms |
17680 KB |
Output is correct |
8 |
Correct |
680 ms |
19692 KB |
Output is correct |
9 |
Correct |
1330 ms |
22592 KB |
Output is correct |
10 |
Correct |
47 ms |
16488 KB |
Output is correct |
11 |
Correct |
40 ms |
16384 KB |
Output is correct |
12 |
Correct |
8 ms |
16084 KB |
Output is correct |
13 |
Correct |
7 ms |
16084 KB |
Output is correct |
14 |
Correct |
7 ms |
16084 KB |
Output is correct |
15 |
Correct |
7 ms |
16084 KB |
Output is correct |
16 |
Correct |
751 ms |
19524 KB |
Output is correct |
17 |
Correct |
715 ms |
20516 KB |
Output is correct |
18 |
Correct |
314 ms |
17768 KB |
Output is correct |
19 |
Correct |
657 ms |
19544 KB |
Output is correct |
20 |
Correct |
1313 ms |
22636 KB |
Output is correct |
21 |
Correct |
43 ms |
16488 KB |
Output is correct |
22 |
Correct |
41 ms |
16380 KB |
Output is correct |
23 |
Execution timed out |
5052 ms |
45540 KB |
Time limit exceeded |
24 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
16084 KB |
Output is correct |
2 |
Correct |
55 ms |
16660 KB |
Output is correct |
3 |
Correct |
24 ms |
16332 KB |
Output is correct |
4 |
Correct |
62 ms |
16736 KB |
Output is correct |
5 |
Correct |
87 ms |
16852 KB |
Output is correct |
6 |
Correct |
53 ms |
16612 KB |
Output is correct |
7 |
Correct |
14 ms |
16268 KB |
Output is correct |
8 |
Correct |
14 ms |
16248 KB |
Output is correct |
9 |
Correct |
22 ms |
16340 KB |
Output is correct |
10 |
Correct |
39 ms |
16484 KB |
Output is correct |
11 |
Correct |
7 ms |
16084 KB |
Output is correct |
12 |
Correct |
61 ms |
16664 KB |
Output is correct |
13 |
Correct |
25 ms |
16340 KB |
Output is correct |
14 |
Correct |
64 ms |
16748 KB |
Output is correct |
15 |
Correct |
82 ms |
16804 KB |
Output is correct |
16 |
Correct |
51 ms |
16568 KB |
Output is correct |
17 |
Correct |
17 ms |
16212 KB |
Output is correct |
18 |
Correct |
14 ms |
16212 KB |
Output is correct |
19 |
Correct |
23 ms |
16340 KB |
Output is correct |
20 |
Correct |
38 ms |
16476 KB |
Output is correct |
21 |
Correct |
43 ms |
16448 KB |
Output is correct |
22 |
Correct |
40 ms |
16364 KB |
Output is correct |
23 |
Correct |
449 ms |
18656 KB |
Output is correct |
24 |
Correct |
295 ms |
17676 KB |
Output is correct |
25 |
Correct |
461 ms |
18832 KB |
Output is correct |
26 |
Correct |
685 ms |
19796 KB |
Output is correct |
27 |
Correct |
528 ms |
18956 KB |
Output is correct |
28 |
Correct |
306 ms |
17768 KB |
Output is correct |
29 |
Correct |
7 ms |
16084 KB |
Output is correct |
30 |
Correct |
62 ms |
16652 KB |
Output is correct |
31 |
Correct |
26 ms |
16272 KB |
Output is correct |
32 |
Correct |
60 ms |
16752 KB |
Output is correct |
33 |
Correct |
81 ms |
16844 KB |
Output is correct |
34 |
Correct |
50 ms |
16560 KB |
Output is correct |
35 |
Correct |
15 ms |
16272 KB |
Output is correct |
36 |
Correct |
13 ms |
16212 KB |
Output is correct |
37 |
Correct |
23 ms |
16276 KB |
Output is correct |
38 |
Correct |
37 ms |
16472 KB |
Output is correct |
39 |
Correct |
42 ms |
16464 KB |
Output is correct |
40 |
Correct |
43 ms |
16308 KB |
Output is correct |
41 |
Correct |
448 ms |
18656 KB |
Output is correct |
42 |
Correct |
301 ms |
17744 KB |
Output is correct |
43 |
Correct |
460 ms |
18660 KB |
Output is correct |
44 |
Correct |
669 ms |
19624 KB |
Output is correct |
45 |
Correct |
511 ms |
19004 KB |
Output is correct |
46 |
Correct |
312 ms |
17876 KB |
Output is correct |
47 |
Correct |
354 ms |
17628 KB |
Output is correct |
48 |
Correct |
382 ms |
17556 KB |
Output is correct |
49 |
Execution timed out |
5049 ms |
37860 KB |
Time limit exceeded |
50 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
16084 KB |
Output is correct |
2 |
Correct |
7 ms |
16176 KB |
Output is correct |
3 |
Correct |
6 ms |
16084 KB |
Output is correct |
4 |
Correct |
7 ms |
16084 KB |
Output is correct |
5 |
Correct |
752 ms |
19532 KB |
Output is correct |
6 |
Correct |
729 ms |
20512 KB |
Output is correct |
7 |
Correct |
314 ms |
17680 KB |
Output is correct |
8 |
Correct |
680 ms |
19692 KB |
Output is correct |
9 |
Correct |
1330 ms |
22592 KB |
Output is correct |
10 |
Correct |
47 ms |
16488 KB |
Output is correct |
11 |
Correct |
40 ms |
16384 KB |
Output is correct |
12 |
Correct |
8 ms |
16084 KB |
Output is correct |
13 |
Correct |
7 ms |
16084 KB |
Output is correct |
14 |
Correct |
7 ms |
16084 KB |
Output is correct |
15 |
Correct |
7 ms |
16084 KB |
Output is correct |
16 |
Correct |
751 ms |
19524 KB |
Output is correct |
17 |
Correct |
715 ms |
20516 KB |
Output is correct |
18 |
Correct |
314 ms |
17768 KB |
Output is correct |
19 |
Correct |
657 ms |
19544 KB |
Output is correct |
20 |
Correct |
1313 ms |
22636 KB |
Output is correct |
21 |
Correct |
43 ms |
16488 KB |
Output is correct |
22 |
Correct |
41 ms |
16380 KB |
Output is correct |
23 |
Execution timed out |
5052 ms |
45540 KB |
Time limit exceeded |
24 |
Halted |
0 ms |
0 KB |
- |