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>
#define int long long
using namespace std;
const int JFF = 300000;
long long count_tastiness(long long x, std::vector<long long> a) {
int n = a.size();
int ct = 0;
int ava = 0;
for (int k=0; k<min(JFF,1LL<<n); k++) {
int fail = 0;
for (int i=0; i<n; i++) {
ava+=a[i];
if (k&(1LL<<i)) {
ava-=x;
}
if (ava<0) {
fail=1;
break;
}
ava/=2;
}
ct+=1-fail;
}
return ct;
}
# | 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... |