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>
typedef long long ll;
using namespace std;
long long count_tastiness(long long x, vector<long long> a) {
if (x > 100000) return 1;
int k = a.size();
ll ans = 1;
for (int val = 1; val * x <= 1e5; val++){
vector<ll> b = a;
bool ok = true;
for (int it = 0; it < x; it++){
ll y = val;
for (int i = k - 1; i >= 0; i--){
ll cur = min(b[i], y / (1ll << i));
y -= (1ll << i) * cur;
b[i] -= cur;
}
if (y) ok = false;
}
if (ok) ans++;
}
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... |