제출 #675495

#제출 시각아이디문제언어결과실행 시간메모리
675495VodkaInTheJar비스킷 담기 (IOI20_biscuits)C++14
0 / 100
32 ms7948 KiB
#include <bits/stdc++.h> #pragma GCC optimize("O3") #define endl '\n' using namespace std; map <long long, long long> dp[64]; long long f(int pos, long long pr, long long x, vector <long long> &a) { long long sum = pr; if (pos < (int)a.size()) sum += a[pos]; if (sum < x && pos >= (int)a.size()) return 0; if (dp[pos].count(pr)) return dp[pos][pr]; long long ans = f(pos + 1, sum >> 1ll, x, a); if (sum >= x) ans += f(pos + 1, (sum - x) >> 1ll, x, a); return dp[pos][pr] = ans; } long long count_tastiness(long long x, vector <long long> a) { return f(0, 0, x, a); }
#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...