# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1055541 | Trent | Packing Biscuits (IOI20_biscuits) | C++17 | 1 ms | 348 KiB |
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;
#define forR(i, x) for(int i = 0; i < (x); ++i)
#define REP(i, a, b) for(int i = (a); i < (b); ++i)
#define all(x) x.begin(), x.end()
typedef long long ll;
typedef vector<ll> vll;
ll valOf(ll msk, vll& dc) {
ll ret = 0;
forR(i, dc.size()) if(msk & (1 << i)) ret += dc[dc.size() - 1 - i];
return ret;
}
long long count_tastiness(long long x, std::vector<long long> a) {
int k = a.size();
vll vals = {a[0]};
forR(i, k) {
if(i + 1 < k) {
vll nex;
for(ll j : vals) {
nex.push_back(j / 2 + a[i+1]);
if(x <= j) nex.push_back((j-x) / 2 + a[i+1]);
}
vals.swap(nex);
} else {
ll tot = 0;
for(ll j : vals) tot += j >= x ? 2 : 1;
return tot;
}
}
}
Compilation message (stderr)
# | 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... |