제출 #921355

#제출 시각아이디문제언어결과실행 시간메모리
921355ksujay2비스킷 담기 (IOI20_biscuits)C++17
0 / 100
1092 ms198244 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; ll count_tastiness(ll x, vector<ll> a) { int k = a.size(); map<pair<int, ll>, ll> memo; function<ll(int, ll)> f = [&] (int i, ll y) { if(i < 0) return (ll)(y == 0); if(memo.count({i, y})) return memo[{i, y}]; y = y - a[i] * (1LL << i); memo[{i, y}] = f(i - 1, max(0ll, y)) + f(i - 1, max(0ll, y + x * (1LL << i))); return memo[{i, y}]; }; return f(k - 1, 0); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...