#include "biscuits.h"
#include <bits/stdc++.h>
#define fir first
#define sec second
#define pii pair<int, int>
#define ll long long
using namespace std;
long long count_tastiness(long long x, vector<long long> a) {
while(a.size()<70) a.push_back(0);
for(int i=0;i<60;i++)
{
if(a[i]<=2) continue;
a[i+1]+=(a[i]-1)/2;
if(a[i]%2==0) a[i]=2;
else a[i]=1;
}
ll cnt=1, ans=1;
for(int i=59;i>=0;i--)
{
if(a[i]==0) cnt=ans;
else if(a[i]==1) ans*=2;
else ans=2*ans+cnt;
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Incorrect |
0 ms |
256 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
1 ms |
256 KB |
Output is correct |
3 |
Correct |
0 ms |
256 KB |
Output is correct |
4 |
Correct |
0 ms |
256 KB |
Output is correct |
5 |
Correct |
1 ms |
256 KB |
Output is correct |
6 |
Correct |
1 ms |
256 KB |
Output is correct |
7 |
Correct |
1 ms |
256 KB |
Output is correct |
8 |
Correct |
1 ms |
256 KB |
Output is correct |
9 |
Correct |
1 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Incorrect |
0 ms |
256 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |