# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
592210 | farhan132 | Packing Biscuits (IOI20_biscuits) | C++17 | 1089 ms | 49888 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 pair<ll , ll> ii;
#define ff first
#define ss second
#define pb push_back
#define in insert
unordered_map < ll , ll > mp[61];
vector < ll > a; ll x;
ll DP(ll pos, ll val){
if(pos >= a.size() && val == 0) return 1;
if(pos < a.size()){
val += a[pos];
}
if(mp[pos].count(val)) return mp[pos][val];
ll ret = DP(pos + 1, val / 2);
if(val >= x){
ret += DP(pos + 1, (val - x)/2);
}
return mp[pos][val] = ret;
}
long long count_tastiness(long long _x, std::vector<long long> _a) {
for(ll i = 0; i <= 60; i++) mp[i].clear();
a = _a; x = _x;
return DP(0, 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... |