# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
605363 | SamAnd | Packing Biscuits (IOI20_biscuits) | C++17 | 1105 ms | 111792 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 fi first
#define se second
#define m_p make_pair
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
typedef long long ll;
const int X = 20004, K = 202;
map<ll, ll> dp[K];
long long count_tastiness(long long x, std::vector<long long> a)
{
for (int i = 0; i < 66; ++i)
a.push_back(0);
dp[0][0] = 1;
for (int i = 0; i < sz(a); ++i)
{
for (auto it = dp[i].begin(); it != dp[i].end(); ++it)
{
int j = it->fi;
dp[i + 1][(j + a[i]) / 2] += dp[i][j];
if (j + a[i] - x >= 0)
dp[i + 1][(j + a[i] - x) / 2] += dp[i][j];
}
}
ll ans = 0;
for (auto it = dp[sz(a)].begin(); it != dp[sz(a)].end(); ++it)
ans += it->se;
return ans;
}
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... |