# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
834168 | Johann | Packing Biscuits (IOI20_biscuits) | C++14 | 8 ms | 1108 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;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
ll X;
long long count_tastiness(long long _X, std::vector<long long> a)
{
vi b;
X = _X;
for (int i = 0; i < sz(a); ++i)
{
if (a[i] >= X && i + 1 >= sz(a))
a.push_back(0);
ll tmp = a[i] / X;
if (tmp & 1)
b.push_back(1);
else
b.push_back(min(2LL, tmp));
if (i + 1 < sz(a))
a[i + 1] += (a[i] - b.back() * X) / 2;
}
# | 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... |