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 "bits/stdc++.h"
using namespace std;
long long count_tastiness(long long x, std::vector<long long> a) {
int k = a.size();
__int128 rr = 0;
__int128 ans = 1;
__int128 div = 1;
for(int i=0; i<k; i++) {
__int128 pp = (1ll << i);
rr += (pp / div) * (__int128) a[i];
if(i+1 < k && rr < pp / div * 2) {
ans *= rr;
rr = 1;
div = pp * 2;
}
}
ans *= rr;
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... |