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 <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <ctime>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <limits>
#include <iomanip>
#include <unordered_set>
#include <unordered_map>
#include <random>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef ll itn;
#define ff first
#define ss second
ll n;
ll count_tastiness(ll x, vector<ll> a) {
n = a.size();
ll sum = 0;
for (int i = 0; i < n; i++) {
sum += a[i] * (1ll << i);
}
sum /= x;
ll ans = 0;
for (int y = 0; y <= sum; y++) {
vector<ll>c = a;
bool ys = true;
for (int i = 0; i < x; i++) {
ll val = y;
for (int j = n - 1; j >= 0; j--) {
ll cnt = val / (1ll << j);
ll v = min(cnt, c[j]);
c[j] -= v;
val -= v * (1ll << j);
}
if (val != 0) {
ys = false;
break;
}
}
ans += ys;
}
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... |