#include "biscuits.h"
#include <bits/stdc++.h>
using namespace std;
long long count_tastiness(long long x,vector<long long> a) {
if(x > 100000)return 1;
vector<long long> powr;
powr.push_back(1);
for(int i=1;i<=61;i++){
powr.push_back(powr.back()*2);
}
reverse(a.begin(),a.end());
int res = 1;
for(int y=1;y<=100000;y++){
long long curr = y;
int pwr = a.size() -1;
for(auto i:a){
long long cnt = i;
long long p = powr[pwr];
if(p > curr){
pwr--;
continue;
}
long long take = min(cnt,curr/p);
curr -= take*p;
pwr--;
}
if(curr == 0)res++;
}
return res;
}
// run biscuits 03.in 03.out
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
46 ms |
268 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Incorrect |
9 ms |
204 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
44 ms |
264 KB |
Output is correct |
2 |
Incorrect |
33 ms |
204 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
72 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
332 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
46 ms |
268 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Incorrect |
9 ms |
204 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |