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;
typedef long long ll;
#define sz(x) (int)(x).size()
ll count_tastiness(ll x, vector<ll> a) {
ll ret = 1;
unordered_map<ll,ll> act;
act[0] = 1;
for (int i = 0; i < 60; i++) {
unordered_map<ll,ll> nx;
for (auto val: act) {
ll p = val.first;
p = p / 2 + (i < sz(a) ? a[i] : 0);
nx[p] += val.second;
if (p >= x) {
ret += val.second;
nx[p - x] += val.second;
}
}
swap(act, nx);
}
return ret;
}
# | 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... |