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 <bits/stdc++.h>
using namespace std;
#include "biscuits.h"
#define int long long
#define loop(x, i) for (int i = 0; i < x; i++)
#define pb push_back
#define ALL(x) (x).begin(), (x).end()
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef set<int> si;
typedef vector<vi> vvi;
int count_tastiness(int x, vi a)
{
int res = 0;
int max = 100'000;
for (int v = 0; v <= max; v++)
{
int left = v;
for (int i = ((int)a.size()) - 1; i >= 0; i--)
{
int pow = 1;
loop(i, j) pow *= 2;
if (pow > v)
continue;
int take = left / pow;
take = min(take, a[i]);
left -= take * pow;
}
if (left == 0)
res++;
}
return res;
}
# | 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... |