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"
using namespace std;
typedef vector<long long> vll;
const int N = 60, Z = 100000;
long long max(long long a, long long b) { return a > b ? a : b; }
long long count_tastiness(long long x, vll aa) {
int n = aa.size(), i, cnt;
long long y;
cnt = 0;
for (y = 0; x * y <= Z; y++) {
long long a = 0;
for (i = N - 1; i >= 0; i--) {
if ((y & 1LL << i) != 0)
a += x;
a = max(a - (i < n ? aa[i] : 0), 0) * 2;
}
if (a == 0)
cnt++;
}
return cnt;
}
# | 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... |