#include "biscuits.h"
#include<bits/stdc++.h>
using namespace std;
long long a,b,c,d,e,i,j,ii,jj,zx,xc,f[209],x,S[209],JM,xr[209],E,jm,v[200009],vi;
long long tes,te;
//vector <long long> v;
long long count_tastiness(long long Xx, std::vector<long long> A) {
x=Xx;
a=A.size();a--;
for(i=0; i<=a; i++){
f[i]=A[i];
}
for(i=a+1; i<=a+135; i++){
f[i]=0;
}
xr[0]=1;
for(i=1; i<=62; i++){
xr[i]=xr[i-1]*2;
}
jm=0;
for(i=0; i<=a; i++){
jm+=f[i]*xr[i];
}
/*v.clear();
v.push_back(0);*/
vi=0;
v[vi]=0;
JM=0;
for(i=0; i<=a+134; i++){
JM+=f[i]*xr[i];
if(xr[i]>jm) break;
S[i]=JM;
//E=v.size();
E=vi+1;
for(j=0; j<E; j++){
//if(x*(xr[i]+v[j])>S[i]) continue;
if((xr[i]+v[j])>S[i]/x) break;
//v.push_back(xr[i]+v[j]);
vi++;
v[vi]=xr[i]+v[j];
}
}
//return v.size();
return vi+1;
}
/*int main(){
ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin>>tes;
for(te=1; te<=tes; te++){
cin>>a>>x;
vector <long long> A;
for(i=0; i<a; i++){
cin>>c;
A.push_back(c);
}
cout<<count_tastiness(x,A)<<endl;
//count_tastiness(x,A);
}
return 0;
}*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
972 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
588 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
2 ms |
972 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
2 ms |
972 KB |
Output is correct |
9 |
Correct |
1 ms |
332 KB |
Output is correct |
10 |
Correct |
1 ms |
204 KB |
Output is correct |
11 |
Correct |
1 ms |
204 KB |
Output is correct |
12 |
Correct |
2 ms |
332 KB |
Output is correct |
13 |
Correct |
1 ms |
332 KB |
Output is correct |
14 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
972 KB |
Output is correct |
2 |
Runtime error |
3 ms |
3532 KB |
Execution killed with signal 11 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
4 ms |
3532 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
106 ms |
1920 KB |
Output is correct |
2 |
Correct |
207 ms |
2628 KB |
Output is correct |
3 |
Correct |
201 ms |
2744 KB |
Output is correct |
4 |
Correct |
231 ms |
2740 KB |
Output is correct |
5 |
Correct |
191 ms |
2740 KB |
Output is correct |
6 |
Correct |
205 ms |
2636 KB |
Output is correct |
7 |
Correct |
205 ms |
2700 KB |
Output is correct |
8 |
Correct |
203 ms |
2628 KB |
Output is correct |
9 |
Correct |
202 ms |
2716 KB |
Output is correct |
10 |
Correct |
218 ms |
2616 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
972 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
588 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
2 ms |
972 KB |
Output is correct |
7 |
Correct |
1 ms |
332 KB |
Output is correct |
8 |
Correct |
2 ms |
972 KB |
Output is correct |
9 |
Correct |
1 ms |
332 KB |
Output is correct |
10 |
Correct |
1 ms |
204 KB |
Output is correct |
11 |
Correct |
1 ms |
204 KB |
Output is correct |
12 |
Correct |
2 ms |
332 KB |
Output is correct |
13 |
Correct |
1 ms |
332 KB |
Output is correct |
14 |
Correct |
1 ms |
204 KB |
Output is correct |
15 |
Correct |
1 ms |
972 KB |
Output is correct |
16 |
Runtime error |
3 ms |
3532 KB |
Execution killed with signal 11 |
17 |
Halted |
0 ms |
0 KB |
- |