#include "biscuits.h"
#include <stdio.h>
using namespace std;
long long con[105]={0};
long long count_tastiness(long long x,vector<long long> a)
{
long long ans=1,t=0,N=a.size(),i;
for(i=0;i<N||con[i];i++)
{
con[i]=a[i];
if(con[i]>2)
{
if(con[i]%2==0)
{
con[i+1]=con[i]/2-1;
con[i]=2;
}
else
{
con[i+1]=con[i]/2;
con[i]=1;
}
}
}
N=i;
t=0;
for(i=0;i<N;i++)
{
if(con[i]==0)
{
ans=ans*(t+1);
t=0;
}
else
{
t+=(long long) (1<<i)*con[i];
}
//printf("%lld %lld\n",i,t);
}
ans=ans*(t+1);
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
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 |
0 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |