QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#119710 | #276. Split the sequence | myee | 100 ✓ | 479ms | 85292kb | C++11 | 2.5kb | 2023-07-05 15:17:10 | 2023-07-05 15:17:12 |
Judging History
answer
// 有显然贡献的结论。
// 斜率优化 dp 即可。
// 要记得记录过程。
// 至于分治决策单调性什么的还是想多了……估计跑不过去。
#include <algorithm>
#include <deque>
#include <stdio.h>
#include <vector>
typedef long long llt;
typedef unsigned uint;typedef unsigned long long ullt;
typedef bool bol;typedef char chr;typedef void voi;
typedef double dbl;
template<typename T>bol _max(T&a,T b){return(a<b)?a=b,true:false;}
template<typename T>bol _min(T&a,T b){return(b<a)?a=b,true:false;}
template<typename T>T lowbit(T n){return n&-n;}
template<typename T>T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<typename T>T lcm(T a,T b){return(a!=0||b!=0)?a/gcd(a,b)*b:(T)0;}
template<typename T>T exgcd(T a,T b,T&x,T&y){if(b!=0){T ans=exgcd(b,a%b,y,x);y-=a/b*x;return ans;}else return y=0,x=1,a;}
template<typename T>T power(T base,T index,T mod)
{
T ans=1%mod;
while(index)
{
if(index&1)ans=ans*base%mod;
base=base*base%mod,index>>=1;
}
return ans;
}
llt S[100005],Last[100005],Ans[100005];uint AnsP[205][100005];
uint n;
voi doit(llt*Last,llt*Ans,uint*AnsP)
{
typedef std::pair<llt,llt>Line;
Ans[0]=-1e18,AnsP[0]=-1;
std::deque<std::pair<Line,uint> >D{{{0,Last[0]},0}};
auto val=[](Line L,llt v){return L.first*v+L.second;};
for(uint i=1;i<=n;i++)
{
while(D.size()>1&&val(D[0].first,S[i])<=val(D[1].first,S[i]))D.pop_front();
Ans[i]=val(D[0].first,S[i]),AnsP[i]=D[0].second;
Line L{S[i],Last[i]-S[i]*S[i]};
while(D.size()&&D.back().first.first==L.first&&D.back().first.second<=L.second)D.pop_back();
if(D.size()&&D.back().first.first==L.first)continue;
while(D.size()>1)
{
Line L1=D.back().first,L2=D[D.size()-2].first;
if((L2.second-L.second)*(L2.first-L1.first)>=(L2.second-L1.second)*(L2.first-L.first))D.pop_back();
else break;
}
D.push_back({L,i});
}
}
int main()
{
#ifdef MYEE
freopen("QAQ.in","r",stdin);
// freopen("QAQ.out","w",stdout);
#endif
Ans[0]=-1e18,AnsP[0][0]=-1;
uint k;scanf("%u%u",&n,&k);
for(uint i=1;i<=n;i++)scanf("%lld",S+i),S[i]+=S[i-1];
for(uint i=1;i<=k;i++)
{
for(uint j=0;j<=n;j++)Last[j]=Ans[j],Ans[j]=0;
doit(Last,Ans,AnsP[i]);
}
printf("%lld\n",Ans[n]);
for(uint i=k,p=n;i;i--)printf("%u%c",AnsP[i][p]," \n"[i==1]),p=AnsP[i][p];
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 11
Accepted
Test #1:
score: 11
Accepted
time: 1ms
memory: 5072kb
input:
7 3 4 1 3 4 0 2 3
output:
108 5 3 1
result:
ok contestant found the optimal answer: 108 == 108
Test #2:
score: 0
Accepted
time: 0ms
memory: 7208kb
input:
10 2 1 2 3 4 5 6 7 8 9 10
output:
999 8 6
result:
ok contestant found the optimal answer: 999 == 999
Test #3:
score: 0
Accepted
time: 0ms
memory: 5152kb
input:
2 1 0 123
output:
0 1
result:
ok contestant found the optimal answer: 0 == 0
Test #4:
score: 0
Accepted
time: 2ms
memory: 9136kb
input:
10 5 1 1 1 1 1234 1 1 1 1 1234
output:
1542524 9 7 5 4 2
result:
ok contestant found the optimal answer: 1542524 == 1542524
Test #5:
score: 0
Accepted
time: 2ms
memory: 11300kb
input:
10 9 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000
output:
4500000000 9 8 7 6 5 4 3 2 1
result:
ok contestant found the optimal answer: 4500000000 == 4500000000
Test #6:
score: 0
Accepted
time: 1ms
memory: 5116kb
input:
10 1 0 0 0 0 0 0 0 0 1 1
output:
1 9
result:
ok contestant found the optimal answer: 1 == 1
Test #7:
score: 0
Accepted
time: 2ms
memory: 9144kb
input:
10 1 1 1 0 0 0 0 0 0 0 0
output:
1 1
result:
ok contestant found the optimal answer: 1 == 1
Test #8:
score: 0
Accepted
time: 1ms
memory: 5052kb
input:
10 1 0 0 0 0 1 1 0 0 0 0
output:
1 5
result:
ok contestant found the optimal answer: 1 == 1
Test #9:
score: 0
Accepted
time: 1ms
memory: 5128kb
input:
10 3 0 4 2 2 4 4 3 1 10000 10000
output:
100400096 9 8 5
result:
ok contestant found the optimal answer: 100400096 == 100400096
Test #10:
score: 0
Accepted
time: 0ms
memory: 7116kb
input:
10 3 10000 10000 10000 10000 10000 1 2 1 3 1
output:
900320000 4 3 2
result:
ok contestant found the optimal answer: 900320000 == 900320000
Test #11:
score: 0
Accepted
time: 2ms
memory: 7112kb
input:
10 3 9996 9998 9999 9997 9996 9998 9998 9996 10000 9996
output:
3698080248 8 5 2
result:
ok contestant found the optimal answer: 3698080248 == 3698080248
Test #12:
score: 0
Accepted
time: 2ms
memory: 7116kb
input:
10 4 10000 10000 10000 10000 10000 4 10000 10000 10000 10000
output:
3200320000 8 6 4 2
result:
ok contestant found the optimal answer: 3200320000 == 3200320000
Test #13:
score: 0
Accepted
time: 0ms
memory: 5184kb
input:
9 4 10000 1 4 0 2 1 3 2 1
output:
140072 7 6 4 1
result:
ok contestant found the optimal answer: 140072 == 140072
Test #14:
score: 0
Accepted
time: 2ms
memory: 9144kb
input:
7 3 1445 914 9661 6869 604 6980 5672
output:
376041456 6 5 3
result:
ok contestant found the optimal answer: 376041456 == 376041456
Test #15:
score: 0
Accepted
time: 1ms
memory: 5060kb
input:
10 4 0 1 2 3 4 5 6 7 8 9
output:
805 9 8 7 5
result:
ok contestant found the optimal answer: 805 == 805
Test #16:
score: 0
Accepted
time: 0ms
memory: 7192kb
input:
10 3 10000 1 9997 1 9999 4 9999 4 9997 2
output:
900189994 7 5 2
result:
ok contestant found the optimal answer: 900189994 == 900189994
Test #17:
score: 0
Accepted
time: 1ms
memory: 5060kb
input:
10 4 9999 0 9996 1 9999 0 9997 4 10000 2
output:
999919994 8 6 4 2
result:
ok contestant found the optimal answer: 999919994 == 999919994
Subtask #2:
score: 11
Accepted
Dependency #1:
100%
Accepted
Test #18:
score: 11
Accepted
time: 0ms
memory: 7288kb
input:
50 3 3 1 2 2 3 2 3 4 1 4 0 4 4 4 0 0 4 3 3 1 1 4 0 1 4 4 0 1 2 2 2 2 4 1 3 0 3 3 0 3 3 4 2 1 0 1 3 4 3 10000
output:
1093956 49 33 16
result:
ok contestant found the optimal answer: 1093956 == 1093956
Test #19:
score: 0
Accepted
time: 1ms
memory: 7108kb
input:
50 3 10000 10000 10000 4 0 1 3 3 4 0 3 2 1 4 2 2 2 1 4 2 4 2 1 3 1 0 1 2 3 2 2 0 3 0 3 4 4 0 1 0 3 0 0 3 1 0 0 1 0 0
output:
302460000 3 2 1
result:
ok contestant found the optimal answer: 302460000 == 302460000
Test #20:
score: 0
Accepted
time: 4ms
memory: 23656kb
input:
50 49 10000 9996 10000 9997 9998 9999 9998 9998 9996 9996 10000 9999 9999 9998 9996 10000 10000 10000 9996 9998 9997 10000 9997 9998 9997 9997 9998 9996 9997 10000 10000 9996 10000 9996 9997 10000 9997 9996 9996 10000 10000 9997 10000 9999 9996 9998 10000 9999 9997 10000
output:
122453454361 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
result:
ok contestant found the optimal answer: 122453454361 == 122453454361
Test #21:
score: 0
Accepted
time: 1ms
memory: 5224kb
input:
50 3 9998 9999 10000 9998 9998 10000 9996 9998 9997 9998 9997 10000 9997 10000 10000 9998 9998 9996 9998 10000 9999 9996 9999 9996 9998 9999 10000 9999 9997 9998 9997 9999 10000 9996 9996 9997 10000 9997 9997 9999 9998 10000 9999 9998 9996 9997 9997 9997 9999 9997
output:
93663683509 37 25 12
result:
ok contestant found the optimal answer: 93663683509 == 93663683509
Test #22:
score: 0
Accepted
time: 2ms
memory: 7112kb
input:
50 10 10000 10000 10000 4 4 1 4 0 0 4 1 2 3 3 4 4 4 3 3 0 1 2 2 3 3 3 4 2 3 2 3 2 4 2 0 3 0 2 0 0 4 1 4 2 4 2 4 0 10000 10000
output:
1005304678 49 48 41 31 25 17 12 3 2 1
result:
ok contestant found the optimal answer: 1005304678 == 1005304678
Test #23:
score: 0
Accepted
time: 2ms
memory: 7228kb
input:
50 7 10000 1 2 0 1 2 1 2 3 4 3 1 0 4 3 3 1 2 1 4 1 4 3 3 0 1 4 2 2 3 1 2 2 0 2 1 1 0 2 3 3 0 2 1 1 2 0 4 1 4
output:
933702 42 32 26 20 14 9 1
result:
ok contestant found the optimal answer: 933702 == 933702
Test #24:
score: 0
Accepted
time: 1ms
memory: 13256kb
input:
50 25 8300 1781 4510 1499 3323 5656 8037 3964 5309 399 1701 988 3190 7288 6296 8288 8645 4405 4454 683 4963 8675 4693 4935 9403 448 7697 4887 7572 8129 1078 2012 1506 4203 3991 1721 8310 7023 7218 6064 6646 6753 805 5724 59 1566 2362 8171 1171 2095
output:
25082842857 47 43 41 39 38 37 35 32 29 27 25 24 22 21 19 17 16 15 14 13 9 7 6 4 1
result:
ok contestant found the optimal answer: 25082842857 == 25082842857
Test #25:
score: 0
Accepted
time: 2ms
memory: 9276kb
input:
50 11 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
output:
687136 48 46 44 42 39 36 33 30 26 21 15
result:
ok contestant found the optimal answer: 687136 == 687136
Test #26:
score: 0
Accepted
time: 2ms
memory: 11308kb
input:
50 7 9996 4 9999 1 10000 0 10000 3 9997 1 9997 3 9996 1 9998 1 9997 2 9997 1 10000 2 9998 1 9996 0 9999 1 9998 2 9997 1 9996 3 9996 0 9996 2 9999 4 9998 3 10000 0 9996 1 9999 0 9996 3
output:
27295930079 44 37 30 23 18 11 6
result:
ok contestant found the optimal answer: 27295930079 == 27295930079
Test #27:
score: 0
Accepted
time: 2ms
memory: 11256kb
input:
50 14 9998 4 9997 1 9996 3 9999 1 9999 1 9998 3 9996 0 9998 2 10000 0 10000 2 9996 0 9996 3 9998 2 9996 4 9997 1 10000 4 10000 1 10000 2 9997 2 10000 0 9996 4 10000 3 10000 2 9997 3 9996 3
output:
29000419931 46 43 41 37 34 31 28 24 19 16 11 8 5 2
result:
ok contestant found the optimal answer: 29000419931 == 29000419931
Subtask #3:
score: 11
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Test #28:
score: 11
Accepted
time: 1ms
memory: 5232kb
input:
200 3 3 2 0 2 3 2 0 3 3 4 3 0 3 1 4 1 3 2 2 3 1 3 4 0 2 3 3 2 2 1 4 0 0 1 0 1 2 4 1 1 0 2 2 3 0 3 1 0 4 4 1 1 4 3 3 1 1 0 1 3 0 4 1 3 2 1 4 0 0 2 0 4 4 1 2 1 3 1 0 1 4 3 0 0 0 2 1 0 4 0 1 3 0 2 4 0 2 0 4 0 1 1 0 3 3 2 1 4 0 0 0 3 2 1 1 4 2 4 2 0 2 0 0 3 2 3 2 0 1 2 0 0 0 4 3 1 3 1 2 2 4 3 3 1 4 2 2 ...
output:
610590000 199 198 197
result:
ok contestant found the optimal answer: 610590000 == 610590000
Test #29:
score: 0
Accepted
time: 2ms
memory: 7104kb
input:
200 3 10000 10000 10000 3 1 2 1 0 3 4 3 3 0 4 1 2 0 1 1 4 4 2 3 0 3 3 2 1 2 1 4 2 2 1 3 1 1 2 1 1 4 2 4 3 2 4 0 3 1 4 0 4 0 4 3 4 4 1 4 0 0 2 2 1 2 0 4 1 1 2 3 4 4 1 2 3 3 2 2 4 2 1 0 0 2 2 1 3 1 2 0 3 1 4 3 4 2 3 0 4 2 0 0 4 3 1 0 4 3 4 3 1 4 4 0 1 0 4 4 3 2 3 0 1 0 4 4 0 3 0 1 0 3 3 0 2 4 1 4 4 0 ...
output:
311760000 3 2 1
result:
ok contestant found the optimal answer: 311760000 == 311760000
Test #30:
score: 0
Accepted
time: 3ms
memory: 82884kb
input:
200 199 9997 10000 10000 9998 9997 9997 9999 9997 9998 10000 9997 9998 9998 9997 9998 9996 9996 9996 9999 9998 10000 10000 9996 10000 9997 9996 9998 9996 10000 10000 10000 10000 9996 9997 9997 9999 9997 9999 9998 10000 9999 9998 9996 9997 9997 9999 9999 9996 9996 10000 10000 9996 9997 10000 9999 100...
output:
1989216017013 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 12...
result:
ok contestant found the optimal answer: 1989216017013 == 1989216017013
Test #31:
score: 0
Accepted
time: 1ms
memory: 5060kb
input:
200 3 9996 9996 9998 9997 9998 9997 9996 9999 9997 10000 9997 10000 9997 9997 9999 10000 9997 9999 9996 10000 9997 9997 9996 9999 9997 9999 9999 9996 9998 9997 10000 9997 9999 9997 10000 9999 9996 9997 9999 10000 10000 9997 10000 9997 10000 10000 10000 9996 9999 9999 10000 9997 9997 9997 9998 9997 1...
output:
1499437552673 150 100 50
result:
ok contestant found the optimal answer: 1499437552673 == 1499437552673
Test #32:
score: 0
Accepted
time: 1ms
memory: 58412kb
input:
200 140 10000 10000 2 2 0 4 0 4 3 1 1 1 0 0 3 1 4 2 3 2 0 0 2 3 0 4 4 2 1 3 4 1 0 3 0 4 3 3 0 3 3 1 3 1 0 0 3 3 2 1 0 0 1 1 0 3 1 0 4 4 2 0 0 4 4 0 1 4 2 4 4 3 4 0 1 2 3 1 4 3 4 1 3 0 3 4 3 1 3 2 0 2 3 2 2 0 1 2 1 2 3 4 0 1 3 1 0 3 4 0 4 4 2 1 4 3 3 2 2 1 0 3 3 1 1 0 3 4 2 3 2 3 0 1 0 1 4 3 1 0 4 3 ...
output:
1019625819 199 198 197 196 195 194 193 192 189 187 186 185 184 183 182 181 180 179 178 177 174 173 172 171 168 167 166 164 161 160 159 158 157 156 155 154 153 152 149 147 145 142 141 140 138 137 136 133 131 130 129 128 127 126 123 122 121 118 117 116 115 114 112 111 110 108 107 105 104 103 101 100 9...
result:
ok contestant found the optimal answer: 1019625819 == 1019625819
Test #33:
score: 0
Accepted
time: 3ms
memory: 74692kb
input:
200 180 10000 0 0 3 4 1 0 0 0 1 2 2 3 4 1 2 3 2 3 3 4 1 4 1 0 2 3 1 3 3 2 1 1 3 1 3 3 3 0 0 1 2 1 3 1 2 1 2 0 2 1 2 4 0 1 4 3 2 1 4 4 3 1 4 0 2 1 0 1 0 3 4 4 4 0 1 4 4 2 3 3 4 4 3 3 1 4 4 3 3 4 1 1 1 4 1 2 2 0 0 10000 0 0 2 3 4 3 4 3 2 4 2 1 3 0 0 2 0 3 2 3 3 4 4 2 0 0 1 2 0 3 4 1 3 3 3 3 2 1 1 0 4 ...
output:
107630884 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 12...
result:
ok contestant found the optimal answer: 107630884 == 107630884
Test #34:
score: 0
Accepted
time: 0ms
memory: 83052kb
input:
200 199 3930 8785 9349 8634 3375 397 4144 4964 6195 190 388 3592 9427 9887 9447 835 5289 9672 932 9118 2787 8461 4376 4951 8493 8157 9047 2564 5196 4502 214 2515 9297 1160 8988 8487 6273 2277 2550 6935 7598 3707 5680 6493 1927 6771 1235 7500 7470 6371 8260 5742 2292 6516 2660 5109 7014 9302 6335 777...
output:
475357671774 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128...
result:
ok contestant found the optimal answer: 475357671774 == 475357671774
Test #35:
score: 0
Accepted
time: 1ms
memory: 21448kb
input:
200 44 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100...
output:
193556962 198 196 194 192 190 188 186 184 182 179 176 173 170 167 164 161 158 155 152 149 146 143 140 137 134 131 128 124 120 116 112 108 104 100 95 90 85 80 74 68 61 53 43 31
result:
ok contestant found the optimal answer: 193556962 == 193556962
Test #36:
score: 0
Accepted
time: 3ms
memory: 15488kb
input:
200 28 9998 4 9996 0 9997 1 9998 1 9999 4 9998 1 9997 0 9997 0 9996 4 10000 4 9999 3 10000 0 9997 4 9997 0 9998 3 9999 3 9997 3 9997 1 9996 1 9997 2 9997 4 9999 4 9999 2 10000 0 9997 1 9999 0 9999 2 9997 1 9998 0 9998 3 10000 1 9997 3 9996 2 9996 0 10000 2 9998 3 9996 1 9997 2 9999 2 9996 1 9998 3 9...
output:
482389919803 192 186 179 172 165 159 152 145 138 132 126 120 113 106 99 92 84 77 70 62 55 48 41 34 28 21 16 8
result:
ok contestant found the optimal answer: 482389919803 == 482389919803
Test #37:
score: 0
Accepted
time: 5ms
memory: 25564kb
input:
200 56 9999 3 9998 4 9997 1 9999 1 10000 0 9998 2 9999 2 9996 2 9998 2 9999 4 9996 0 10000 2 9998 3 9996 2 10000 2 9996 1 9996 1 9998 0 9997 1 9998 0 9999 4 10000 2 9998 3 9998 3 10000 3 9997 3 9999 1 9999 0 9996 0 9996 3 9997 3 9997 0 9999 2 10000 2 9999 3 9998 0 9996 2 10000 2 9996 1 9999 0 9997 4...
output:
490686959791 196 192 189 186 182 178 174 171 168 164 160 156 153 150 147 143 140 137 134 131 128 123 120 116 111 107 104 100 97 94 90 87 84 81 77 74 69 66 62 58 53 50 47 44 41 38 34 30 27 24 20 17 14 11 7 3
result:
ok contestant found the optimal answer: 490686959791 == 490686959791
Subtask #4:
score: 17
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Test #38:
score: 17
Accepted
time: 2ms
memory: 5076kb
input:
1000 3 4 4 0 4 3 4 3 1 3 3 4 0 1 0 4 0 0 4 2 0 0 0 1 3 2 2 3 2 1 2 4 0 2 4 1 1 3 2 2 4 0 0 4 3 1 3 0 3 2 1 1 1 1 0 4 1 0 2 1 3 2 0 1 4 0 0 4 3 0 2 1 1 4 1 3 1 0 4 0 0 3 0 0 1 0 4 1 4 4 1 4 2 3 2 4 1 0 2 2 1 3 3 4 4 0 0 4 4 0 0 1 2 0 4 2 4 3 2 3 0 1 1 4 1 0 0 4 2 0 1 0 0 4 3 3 2 1 4 3 2 3 2 2 3 1 2 4...
output:
21503404 999 669 342
result:
ok contestant found the optimal answer: 21503404 == 21503404
Test #39:
score: 0
Accepted
time: 1ms
memory: 5092kb
input:
1000 3 10000 10000 1 3 3 0 2 3 3 0 0 0 0 1 1 1 0 0 4 2 4 1 2 3 0 2 4 3 3 1 2 4 3 4 4 4 3 0 3 2 1 3 3 0 1 3 4 3 1 0 0 1 3 1 0 3 4 1 0 2 4 4 4 3 2 4 2 3 3 0 1 0 0 0 2 4 2 2 2 3 0 2 1 0 1 2 0 3 0 4 3 3 3 0 3 3 3 2 4 4 3 1 0 0 3 3 3 3 0 3 1 2 0 2 4 2 0 4 4 1 3 2 1 2 4 1 0 1 0 1 0 4 4 3 3 4 2 3 4 0 3 1 1...
output:
140412195 504 2 1
result:
ok contestant found the optimal answer: 140412195 == 140412195
Test #40:
score: 0
Accepted
time: 9ms
memory: 85112kb
input:
1000 199 10000 9998 9999 10000 10000 9997 10000 9997 9998 9998 9996 10000 9996 9997 9998 9999 10000 9998 9997 9998 10000 9999 9997 9997 9996 9997 9999 9999 9999 9998 9996 9999 9998 9998 9997 10000 9996 9999 9999 9997 9998 9998 9996 9997 9998 9998 9999 10000 9996 9999 9996 9996 9997 9996 9996 9998 99...
output:
49729674225461 995 990 985 980 975 970 965 960 955 950 945 940 935 930 925 920 915 910 905 900 895 890 885 880 875 870 865 860 855 850 845 840 835 830 825 820 815 810 805 800 795 790 785 780 775 770 765 760 755 750 745 740 735 730 725 720 715 710 705 700 695 690 685 680 675 670 665 660 655 650 645 6...
result:
ok contestant found the optimal answer: 49729674225461 == 49729674225461
Test #41:
score: 0
Accepted
time: 2ms
memory: 7144kb
input:
1000 3 9998 9998 9996 9997 9998 9999 9997 10000 9998 10000 9997 9999 10000 9998 9998 9999 10000 9998 9997 9998 9996 9996 9996 9998 9996 9996 9996 9997 9999 9997 9997 10000 9999 9996 9998 9996 9996 9998 9999 10000 9996 9998 9999 9997 10000 9998 9998 10000 9999 9997 10000 9996 9998 9997 9996 9998 9996...
output:
37485571387523 750 500 250
result:
ok contestant found the optimal answer: 37485571387523 == 37485571387523
Test #42:
score: 0
Accepted
time: 1ms
memory: 82936kb
input:
1000 200 10000 10000 10000 3 0 4 4 2 2 2 4 1 2 4 2 2 0 1 4 4 3 2 2 3 2 1 0 4 0 3 2 0 2 2 4 2 2 2 0 2 4 4 1 0 2 0 0 1 3 3 2 4 0 4 1 0 0 1 3 3 4 3 1 2 1 0 0 1 4 0 1 4 4 2 2 3 2 3 4 3 3 0 0 3 0 3 0 1 2 1 0 1 2 3 2 0 2 1 1 0 1 2 4 1 3 4 4 1 0 0 1 1 0 4 2 0 4 2 2 3 2 4 2 4 1 2 1 0 2 1 2 3 0 0 2 2 0 3 2 1...
output:
679388326 999 997 993 989 985 982 979 975 967 963 959 956 953 948 944 939 933 929 922 916 911 907 904 899 893 885 880 875 869 864 861 855 850 846 839 833 828 823 818 813 809 806 800 796 792 786 781 776 771 765 760 754 751 747 742 734 724 719 707 701 698 692 688 684 680 676 671 664 658 655 651 647 64...
result:
ok contestant found the optimal answer: 679388326 == 679388326
Test #43:
score: 0
Accepted
time: 8ms
memory: 72736kb
input:
1000 170 10000 2 1 1 2 0 0 1 1 2 1 3 2 4 2 2 2 2 4 3 0 3 3 0 4 0 1 1 4 3 2 4 0 2 3 3 1 1 3 0 3 1 3 1 3 0 1 3 1 0 3 2 1 0 0 2 2 4 4 3 2 0 2 3 3 3 0 1 1 0 1 3 0 1 2 1 2 1 0 3 2 0 1 1 2 3 4 0 4 3 3 4 4 1 2 1 4 4 4 2 10000 2 3 4 3 3 2 3 1 2 0 3 1 3 0 0 1 1 2 2 4 0 2 0 3 1 0 0 4 2 2 1 0 3 4 3 0 0 4 3 4 3...
output:
4699030287 996 993 986 978 972 968 960 955 951 945 939 935 929 925 920 915 911 907 901 900 892 885 879 876 871 867 861 858 851 846 838 831 826 820 814 808 801 800 795 789 779 771 759 750 745 740 735 731 726 719 712 709 701 700 692 688 682 673 665 659 651 646 638 634 624 619 611 602 600 594 589 579 5...
result:
ok contestant found the optimal answer: 4699030287 == 4699030287
Test #44:
score: 0
Accepted
time: 1ms
memory: 82996kb
input:
1000 200 7991 3892 7274 6053 1276 9944 927 8532 4969 5774 9351 6702 1825 3554 6717 9891 7682 9239 2993 101 4636 3149 6481 2613 7173 1302 5291 5891 3796 4820 1148 8752 9446 8984 2619 5052 1761 8425 5036 5103 9652 1990 4264 5247 7568 4201 3823 2724 265 7465 249 5506 3919 7649 962 5232 8845 9582 5994 7...
output:
12418819758185 995 992 988 983 979 976 972 968 963 959 956 951 946 942 937 932 928 923 919 916 911 904 899 894 890 882 878 872 868 862 857 852 848 845 839 835 832 826 821 817 812 805 801 797 794 789 786 783 780 774 769 765 759 753 748 741 734 730 722 718 712 709 702 698 690 686 681 676 672 667 658 6...
result:
ok contestant found the optimal answer: 12418819758185 == 12418819758185
Test #45:
score: 0
Accepted
time: 1ms
memory: 82972kb
input:
1000 200 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 1...
output:
31093317350 951 931 915 902 890 880 870 861 853 845 837 830 823 816 810 804 798 792 786 780 775 770 765 760 755 750 745 740 735 730 726 722 718 714 710 706 702 698 694 690 686 682 678 674 670 666 662 658 654 650 647 644 641 638 635 632 629 626 623 620 617 614 611 608 605 602 599 596 593 590 587 584 ...
result:
ok contestant found the optimal answer: 31093317350 == 31093317350
Test #46:
score: 0
Accepted
time: 5ms
memory: 21544kb
input:
1000 40 9998 2 9996 0 9999 0 9997 2 9999 4 9996 2 9996 4 9997 0 9998 0 9997 3 9997 1 9997 0 9998 3 9999 0 9996 4 10000 1 9996 2 9999 1 9996 3 9999 2 10000 3 9997 0 10000 0 10000 0 9996 4 9999 0 9997 1 9996 3 9998 3 10000 1 9998 0 9999 1 9998 0 9996 4 10000 1 9996 3 10000 3 9998 3 9998 2 9997 2 9998 ...
output:
12194625429236 974 949 924 899 874 850 825 801 778 754 730 705 682 657 632 608 584 559 536 512 487 464 439 416 391 366 341 316 291 268 244 218 193 170 145 122 98 73 49 25
result:
ok contestant found the optimal answer: 12194625429236 == 12194625429236
Test #47:
score: 0
Accepted
time: 1ms
memory: 35804kb
input:
1000 80 9998 3 9997 2 9996 4 9996 4 9999 3 9997 4 9999 3 9997 4 9999 4 9999 1 9998 3 9998 0 9997 3 9997 3 9996 2 10000 3 10000 2 9996 4 9996 1 9997 2 9996 2 9999 4 10000 0 9997 1 9997 0 10000 0 9996 3 10000 3 9997 2 9999 0 10000 4 9996 3 9997 4 9996 3 9997 0 10000 4 9999 1 9996 0 9998 0 9996 0 10000...
output:
12345131038664 987 975 964 951 939 928 916 904 892 880 868 856 843 832 820 808 796 784 772 759 747 736 723 710 697 685 672 660 648 636 624 612 600 587 573 560 547 534 522 509 498 485 473 460 447 434 421 408 395 382 369 356 344 332 319 306 293 280 267 256 243 232 220 207 196 183 172 160 148 136 124 1...
result:
ok contestant found the optimal answer: 12345131038664 == 12345131038664
Subtask #5:
score: 21
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Test #48:
score: 21
Accepted
time: 3ms
memory: 7352kb
input:
10000 3 4 3 2 1 1 2 1 3 0 0 1 0 3 1 1 0 3 1 0 3 2 3 1 1 3 1 0 2 2 4 2 1 0 1 4 1 1 3 0 2 2 2 3 1 1 2 2 2 1 3 3 1 0 0 2 2 2 2 3 2 2 0 0 0 2 3 1 1 4 4 0 1 2 2 2 4 1 3 2 2 1 2 4 3 0 3 2 3 4 2 2 0 0 1 0 1 0 0 1 0 2 3 4 4 4 4 1 1 4 2 0 3 0 0 3 1 3 1 4 1 0 2 0 0 2 0 2 1 4 1 3 3 1 2 4 3 4 2 4 3 4 0 1 0 1 0 ...
output:
1818678304 9998 9996 7492
result:
ok contestant found the optimal answer: 1818678304 == 1818678304
Test #49:
score: 0
Accepted
time: 2ms
memory: 5404kb
input:
10000 3 10000 10000 10000 10000 4 1 0 3 1 1 4 3 3 0 0 0 2 3 4 2 3 2 2 1 3 1 4 0 1 0 2 3 3 3 2 1 1 4 2 1 0 1 0 2 3 2 3 3 1 4 2 4 3 1 2 0 0 2 1 3 1 1 3 3 4 4 1 1 3 4 4 4 3 1 1 1 2 1 3 1 0 0 2 1 4 0 1 2 4 2 4 2 1 3 2 0 1 0 3 4 1 0 3 4 3 4 3 3 1 4 1 1 2 1 3 2 3 2 4 1 3 4 2 4 1 0 4 0 3 3 4 0 3 3 4 4 4 1 ...
output:
1326260195 2455 3 2
result:
ok contestant found the optimal answer: 1326260195 == 1326260195
Test #50:
score: 0
Accepted
time: 29ms
memory: 83380kb
input:
10000 200 9997 9998 9999 10000 9996 9996 9998 9997 9996 9998 9998 10000 9997 9996 10000 9998 9999 9999 9998 9996 9997 9997 9997 9998 9998 10000 9999 9999 9999 9997 9999 10000 9999 9997 9998 9997 9996 9998 9997 9998 9997 10000 9998 10000 9998 9998 9998 10000 9998 9996 10000 9997 9998 9998 9998 10000 ...
output:
4973126687469639 9950 9900 9850 9800 9750 9700 9651 9601 9551 9501 9451 9401 9352 9302 9252 9203 9153 9104 9054 9004 8955 8905 8855 8806 8756 8707 8657 8607 8557 8507 8457 8407 8357 8308 8258 8208 8158 8109 8060 8010 7960 7910 7860 7810 7760 7711 7661 7611 7561 7511 7461 7411 7361 7311 7262 7213 716...
result:
ok contestant found the optimal answer: 4973126687469639 == 4973126687469639
Test #51:
score: 0
Accepted
time: 2ms
memory: 5352kb
input:
10000 3 10000 9998 9996 9997 9999 9997 9998 10000 9998 9997 9999 9996 9998 9997 9996 10000 9997 10000 10000 9999 9998 9998 9998 9997 9998 10000 9997 9997 10000 10000 9997 10000 9997 9999 9997 9998 9997 9996 9998 9999 9999 9999 9997 9999 9996 9996 9996 9998 10000 10000 9999 9996 10000 9998 9999 10000...
output:
3748491676694116 7500 5000 2500
result:
ok contestant found the optimal answer: 3748491676694116 == 3748491676694116
Test #52:
score: 0
Accepted
time: 25ms
memory: 54336kb
input:
10000 120 10000 10000 1 0 4 0 0 0 4 0 1 2 4 4 1 1 4 0 3 2 4 3 4 0 2 1 1 0 1 0 4 2 0 4 3 2 1 1 0 3 3 1 0 4 2 0 2 0 2 3 0 3 3 3 3 1 0 3 1 0 0 4 0 4 4 4 4 3 4 1 4 2 0 1 0 4 3 4 3 3 1 4 0 3 3 2 0 2 0 2 0 1 1 4 0 2 0 0 0 1 0 2 4 4 4 3 3 1 2 4 3 4 3 1 1 1 1 4 1 1 4 1 3 0 4 3 4 0 4 2 3 3 2 1 4 3 3 2 3 2 0 ...
output:
1085432199 9999 9921 9837 9740 9659 9570 9483 9397 9314 9221 9128 9038 8955 8866 8789 8706 8620 8539 8458 8370 8296 8207 8126 8040 7966 7880 7780 7699 7612 7525 7448 7354 7271 7181 7098 7025 6948 6863 6780 6693 6617 6535 6450 6365 6283 6198 6120 6036 5953 5861 5765 5674 5586 5504 5420 5325 5241 5157...
result:
ok contestant found the optimal answer: 1085432199 == 1085432199
Test #53:
score: 0
Accepted
time: 28ms
memory: 62548kb
input:
10000 140 10000 4 2 0 1 1 4 2 0 3 2 2 0 1 4 1 0 1 3 4 1 3 1 4 2 0 0 3 4 0 0 4 0 3 1 0 4 3 3 4 1 1 0 4 2 0 3 2 4 0 3 0 0 4 2 0 4 4 1 1 2 4 2 2 4 1 1 2 1 3 4 4 3 3 0 1 4 0 3 2 4 1 3 4 0 4 3 2 2 0 0 4 2 2 2 2 0 0 2 4 10000 3 2 2 1 1 0 3 4 3 3 3 2 4 1 2 0 2 2 1 3 4 1 2 2 2 2 0 2 4 0 4 3 2 1 0 1 0 2 1 4 ...
output:
514790755404 9900 9801 9745 9700 9601 9551 9500 9402 9400 9301 9246 9200 9101 9019 8945 8869 8779 8700 8601 8554 8500 8401 8400 8301 8216 8148 8068 8000 7901 7900 7801 7748 7700 7601 7529 7454 7400 7301 7300 7201 7153 7100 7001 6937 6868 6800 6701 6700 6602 6519 6441 6359 6281 6200 6101 6034 5974 59...
result:
ok contestant found the optimal answer: 514790755404 == 514790755404
Test #54:
score: 0
Accepted
time: 36ms
memory: 62728kb
input:
10000 150 8145 2828 5436 7600 6583 9304 2982 535 1693 4122 1722 3605 8201 461 7369 3241 8186 4190 7598 1839 1167 772 2804 1763 9263 9488 6503 9420 1618 2491 6961 4205 7652 4087 8228 1772 5909 9754 5108 9555 410 6980 5965 2855 3891 1163 244 6287 9098 7890 4869 6865 4461 7835 7121 2465 4672 359 35 125...
output:
1256105310476641 9934 9869 9803 9740 9676 9613 9549 9478 9417 9354 9297 9230 9163 9095 9029 8965 8891 8817 8750 8684 8624 8552 8490 8421 8360 8302 8244 8180 8112 8053 7989 7923 7855 7786 7722 7648 7586 7518 7452 7385 7311 7247 7181 7114 7045 6979 6915 6843 6774 6702 6637 6574 6501 6431 6354 6287 622...
result:
ok contestant found the optimal answer: 1256105310476641 == 1256105310476641
Test #55:
score: 0
Accepted
time: 33ms
memory: 52540kb
input:
10000 122 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
3099592898816 9799 9715 9651 9597 9549 9506 9464 9418 9366 9305 9229 9108 8830 8736 8668 8612 8563 8519 8478 8433 8383 8326 8256 8158 7875 7763 7689 7630 7579 7533 7491 7448 7400 7345 7280 7194 6944 6791 6710 6647 6594 6547 6504 6462 6416 6364 6303 6226 6101 5826 5734 5666 5610 5561 5517 5475 5430 5...
result:
ok contestant found the optimal answer: 3099592898816 == 3099592898816
Test #56:
score: 0
Accepted
time: 16ms
memory: 58772kb
input:
10000 140 9997 3 9997 0 9996 3 9997 1 9999 1 10000 4 9999 1 9996 1 9998 0 9997 0 10000 1 9996 4 10000 4 10000 3 9999 3 9998 4 9996 3 9999 3 9997 2 9999 2 9998 2 10000 4 10000 2 9996 1 9997 0 9998 1 9997 1 9997 4 10000 2 9996 3 9998 3 9997 4 10000 3 9998 1 9996 4 10000 1 10000 3 9996 2 9998 2 9998 4 ...
output:
1241131419367412 9928 9856 9785 9714 9642 9571 9499 9428 9358 9288 9217 9147 9076 9006 8935 8865 8794 8723 8651 8580 8508 8437 8367 8296 8226 8155 8084 8012 7941 7869 7798 7727 7656 7585 7516 7445 7374 7303 7233 7162 7091 7021 6950 6880 6807 6736 6665 6594 6524 6453 6382 6312 6241 6170 6100 6029 595...
result:
ok contestant found the optimal answer: 1241131419367412 == 1241131419367412
Test #57:
score: 0
Accepted
time: 43ms
memory: 74988kb
input:
10000 180 9997 2 9998 2 10000 2 9996 3 9998 1 10000 1 9996 4 9996 0 9998 0 9999 3 9996 1 9997 3 9996 4 9999 2 9997 4 9999 1 9998 3 9997 1 10000 2 9998 2 9999 4 9997 4 10000 2 9999 0 9998 1 10000 3 9996 0 9998 0 10000 0 9996 2 10000 1 9999 1 10000 4 9998 4 9998 2 9999 0 9999 1 10000 2 9998 0 10000 4 ...
output:
1243084101967798 9944 9887 9832 9776 9721 9666 9610 9554 9500 9445 9391 9336 9280 9225 9170 9114 9060 9006 8950 8896 8841 8786 8731 8675 8620 8564 8510 8456 8401 8346 8289 8234 8179 8123 8068 8014 7960 7905 7850 7795 7741 7686 7632 7577 7523 7468 7412 7358 7303 7248 7191 7136 7080 7024 6968 6912 685...
result:
ok contestant found the optimal answer: 1243084101967798 == 1243084101967798
Subtask #6:
score: 29
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Dependency #5:
100%
Accepted
Test #58:
score: 29
Accepted
time: 14ms
memory: 8308kb
input:
100000 3 4 4 4 4 4 2 0 0 0 3 1 4 4 1 3 1 0 0 3 3 0 3 1 4 1 1 0 3 4 2 0 1 2 1 3 0 2 1 3 0 4 1 2 0 0 4 1 1 3 1 1 0 4 2 3 3 2 4 2 1 2 4 3 2 3 0 1 0 1 3 0 1 4 1 2 0 0 2 4 4 3 1 0 2 4 1 1 3 1 0 2 2 3 1 1 1 1 2 0 0 0 4 2 3 3 3 0 2 2 1 1 4 1 4 2 1 2 3 4 3 1 4 4 1 2 3 1 0 4 0 1 4 0 3 0 1 3 1 0 2 1 0 0 0 2 3...
output:
19795776960 86260 57530 28624
result:
ok contestant found the optimal answer: 19795776960 == 19795776960
Test #59:
score: 0
Accepted
time: 7ms
memory: 9940kb
input:
100000 3 10000 10000 10000 2 3 3 1 0 2 0 0 4 1 1 0 4 3 1 4 0 0 0 0 1 0 4 4 3 4 4 1 2 2 1 3 3 2 3 3 1 0 3 2 3 2 1 3 2 0 1 1 4 2 4 0 4 1 0 1 0 2 2 3 4 1 1 4 2 2 4 3 0 0 2 0 4 2 2 3 3 0 1 2 4 4 0 4 3 4 1 0 3 2 2 3 3 2 2 1 2 4 3 2 4 2 3 1 0 1 4 1 3 1 1 1 0 1 1 0 0 3 1 3 4 2 0 1 0 0 0 0 2 0 2 2 1 4 2 1 0...
output:
19874432173 71322 42470 13758
result:
ok contestant found the optimal answer: 19874432173 == 19874432173
Test #60:
score: 0
Accepted
time: 325ms
memory: 85292kb
input:
100000 200 9998 10000 9999 9996 9998 9996 10000 9997 9997 9996 9996 9996 9998 9999 9998 9996 10000 9996 10000 9998 9996 9999 9999 9999 9996 9996 9998 10000 9999 9997 9997 9999 9998 9999 10000 9996 9997 9996 9998 10000 9998 10000 9997 9998 9997 9999 9997 9998 10000 9998 10000 9998 10000 9999 9999 999...
output:
497313449256899208 99502 99004 98506 98009 97512 97015 96518 96021 95524 95027 94529 94032 93534 93036 92539 92041 91543 91045 90547 90050 89553 89055 88558 88061 87564 87066 86568 86071 85573 85076 84578 84081 83584 83086 82589 82092 81594 81096 80598 80100 79602 79105 78607 78109 77611 77113 76615...
result:
ok contestant found the optimal answer: 497313449256899208 == 497313449256899208
Test #61:
score: 0
Accepted
time: 8ms
memory: 7332kb
input:
100000 3 9999 9999 9996 9998 9996 9996 9998 10000 10000 9999 9996 9999 9997 9996 9997 10000 10000 10000 9997 9996 10000 10000 9997 10000 10000 9996 9997 9998 9999 9996 9997 9997 10000 9999 9997 10000 9999 9996 9997 9996 10000 9996 10000 10000 9997 9999 10000 9999 9999 9998 9996 10000 9996 9999 9996 ...
output:
374850090734572421 75000 50000 25000
result:
ok contestant found the optimal answer: 374850090734572421 == 374850090734572421
Test #62:
score: 0
Accepted
time: 479ms
memory: 85172kb
input:
100000 200 10000 10000 10000 10000 10000 3 4 4 3 3 3 1 4 0 4 1 0 2 2 2 4 1 4 4 1 3 0 4 3 2 0 2 4 2 3 1 4 4 0 1 1 1 0 2 2 0 3 1 1 1 2 3 0 1 0 1 1 4 3 2 4 0 2 0 4 1 1 2 4 4 0 2 0 2 3 1 4 0 3 1 4 4 2 4 4 0 0 4 0 2 3 3 2 4 3 4 4 2 3 3 4 0 3 0 1 4 0 0 2 0 4 3 0 3 1 2 2 2 2 2 0 4 4 4 4 3 2 3 2 0 2 4 1 3 3...
output:
36183271951 99999 99998 99503 98995 98473 97950 97427 96927 96396 95901 95386 94865 94359 93830 93299 92772 92256 91737 91203 90678 90155 89669 89152 88643 88128 87578 87052 86523 86028 85523 84999 84467 83954 83415 82895 82391 81882 81370 80882 80424 79905 79368 78833 78323 77834 77311 76788 76293 ...
result:
ok contestant found the optimal answer: 36183271951 == 36183271951
Test #63:
score: 0
Accepted
time: 309ms
memory: 62644kb
input:
100000 140 10000 3 1 0 0 1 4 2 3 2 3 0 1 2 0 2 3 2 3 3 0 1 2 3 2 2 3 4 0 1 1 0 0 3 3 1 2 4 0 0 0 1 3 0 1 4 2 1 2 2 3 4 2 0 4 0 2 3 0 2 0 4 3 4 3 3 2 4 3 4 0 0 1 3 2 1 2 0 3 0 0 0 3 1 1 4 1 2 2 3 0 2 0 3 2 1 3 0 1 2 10000 0 2 4 1 0 2 3 3 0 4 1 0 1 0 3 0 0 1 1 4 4 1 2 4 1 2 4 0 3 1 1 3 1 4 2 1 2 2 3 4...
output:
51629847150471 99300 98586 97891 97178 96470 95778 95079 94360 93651 92949 92234 91518 90813 90126 89424 88701 88000 87300 86587 85894 85179 84453 83755 83050 82356 81658 80932 80226 79558 78843 78148 77440 76727 76029 75301 74600 73882 73133 72445 71739 71032 70301 69600 68885 68146 67402 66700 659...
result:
ok contestant found the optimal answer: 51629847150471 == 51629847150471
Test #64:
score: 0
Accepted
time: 340ms
memory: 66744kb
input:
100000 150 5874 361 291 3720 8802 8250 810 7549 6726 8465 4194 6148 4315 1819 6470 5851 4552 1272 5588 7790 1112 3165 1188 8130 2326 6417 4492 8463 6848 1220 1259 6021 4090 2043 4384 4591 879 3181 4811 5393 3041 7025 9006 8543 193 497 3659 8732 9177 3022 1805 9826 8175 9473 2869 5129 163 9259 5235 1...
output:
124074747024496432 99333 98677 97999 97312 96674 95997 95342 94663 94021 93370 92699 92025 91371 90691 90050 89384 88708 88046 87382 86703 86058 85382 84717 84081 83463 82822 82143 81456 80817 80124 79451 78796 78142 77469 76813 76166 75497 74834 74177 73519 72852 72196 71523 70844 70180 69505 68885...
result:
ok contestant found the optimal answer: 124074747024496432 == 124074747024496432
Test #65:
score: 0
Accepted
time: 260ms
memory: 54460kb
input:
100000 122 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99...
output:
309959349080800 99306 98433 97532 96646 95821 95248 94394 93499 92603 91746 91170 90350 89465 88564 87689 86942 86301 85429 84528 83640 82810 82240 81389 80495 79598 78739 78159 77345 76461 75560 74683 73915 73294 72424 71524 70635 69801 69232 68384 67491 66593 65731 65145 64339 63457 62556 61678 60...
result:
ok contestant found the optimal answer: 309959349080800 == 309959349080800
Test #66:
score: 0
Accepted
time: 253ms
memory: 62840kb
input:
100000 140 9996 0 9996 0 9997 0 10000 4 9996 2 9997 0 9999 2 9999 0 9996 0 9997 4 10000 2 9997 1 9998 3 9996 0 9997 3 9996 1 9997 4 9996 2 9999 0 9997 2 10000 2 9999 4 9999 4 9997 0 10000 2 10000 2 9997 4 9996 1 9996 3 9998 3 10000 1 9998 0 9999 2 9998 1 10000 3 10000 2 9997 4 9998 1 9997 2 9997 0 1...
output:
124113525649823701 99291 98582 97874 97166 96457 95748 95037 94327 93618 92908 92200 91490 90780 90070 89361 88652 87942 87231 86522 85812 85102 84393 83684 82973 82264 81555 80846 80137 79429 78719 78010 77299 76590 75879 75170 74460 73750 73041 72332 71623 70915 70207 69498 68789 68082 67374 66664...
result:
ok contestant found the optimal answer: 124113525649823701 == 124113525649823701
Test #67:
score: 0
Accepted
time: 338ms
memory: 79024kb
input:
100000 180 9998 4 9997 2 9996 4 9996 1 10000 1 9997 2 9999 0 9999 4 10000 0 9999 3 9996 4 9998 3 9996 3 9999 4 9997 2 9997 4 9996 4 9997 1 9997 4 9996 2 9996 4 9997 1 9999 2 9999 1 9996 1 9997 0 9998 1 9999 2 9996 4 9996 0 9997 0 10000 3 9997 3 9998 0 9997 2 9999 1 9997 1 9997 1 10000 3 9999 0 9996 ...
output:
124309619349406845 99446 98894 98341 97788 97236 96683 96131 95578 95025 94472 93919 93366 92813 92259 91706 91154 90602 90050 89497 88944 88392 87840 87287 86736 86183 85630 85076 84522 83969 83418 82865 82312 81758 81205 80653 80102 79549 78998 78445 77892 77340 76788 76235 75684 75132 74579 74028...
result:
ok contestant found the optimal answer: 124309619349406845 == 124309619349406845