# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
605365 | SamAnd | Packing Biscuits (IOI20_biscuits) | C++17 | 1049 ms | 15688 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;
long long count_tastiness(long long x, std::vector<long long> a)
{
for (int i = 0; i < 66; ++i)
a.push_back(0);
map<ll, ll> dp;
dp[0] = 1;
for (int i = 0; i < sz(a); ++i)
{
map<ll, ll> ndp;
for (auto it = dp.begin(); it != dp.end(); ++it)
{
ll j = it->fi;
ndp[(j + a[i]) / 2] += dp[j];
if (j + a[i] - x >= 0)
ndp[(j + a[i] - x) / 2] += dp[j];
}
dp = ndp;
}
ll ans = 0;
for (auto it = dp.begin(); it != dp.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... |