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;
ll count_tastiness(ll x, vector<ll> a) {
ll ans = 0;
int k = a.size();
while (k < 60){
a.push_back(0);
k++;
}
ll num = 0;
for (int i = 0; i < k; i++){
ll val = (1<<i);
num += val * a[i];
}
for (int i = 0; i <= num; i++){
ll cur = 0;
bool sol = true;
for (int j = 0; j < 20; j++){
cur = cur/2 + a[j];
if (i & (1<<j)){
if (cur < x){
sol = false; break;
}
cur -= x;
}
}
if (sol){
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... |