# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
581940 | joelau | Packing Biscuits (IOI20_biscuits) | C++14 | 1088 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;
long long X;
vector<long long> A;
long long f(long long n) {
if (n == A.size()-1) return A[n]/X+1;
A[n+1] += A[n]/2;
long long ans = f(n+1);
A[n+1] -= A[n]/2;
if (A[n] >= X) {
A[n] -= X, A[n+1] += A[n]/2;
ans += f(n+1);
A[n+1] -= A[n]/2, A[n] += X;
}
return ans;
}
long long count_tastiness(long long x, vector<long long> a) {
X = x, A = a;
return f(0);
}
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... |