This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "biscuits.h"
#include <vector>
using namespace std;
//x = number of people (p)
//y = tastiness of each bag (i)
long long count_tastiness(long long x, vector<long long> a)
{
int k = a.size();
for(int i = 0; i+1 < k; i++)
{
if(a[i] % 2 == 1)
{
a[i+1] += a[i]/2;
a[i] = 1;
}
else
{
a[i+1] += (a[i]-1)/2;
a[i] = 2;
}
}
long long ans = 1;
for(int i = 0; i < k; i++)
if(a[i] >= 1)
ans *= 2;
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |