제출 #436244

#제출 시각아이디문제언어결과실행 시간메모리
436244frodakcin비스킷 담기 (IOI20_biscuits)C++17
9 / 100
1087 ms332 KiB
#include "biscuits.h" #include <map> using ll = long long; const int MX = 200; ll x; std::map<ll, ll> map[MX]; std::vector<ll> a; ll dfs(int d, ll v) { if(d<(int)a.size()) v+=a[d]; if(d>=(int)a.size() && v==0) return 1; auto it=map[d].find(v); if(it != map[d].end()) return it->second; ll ans = dfs(d+1, v/2); if(v>=x) ans += dfs(d+1, (v-x)/2); return ans; } long long count_tastiness(long long _x, std::vector<long long> _a) { x=_x; a=_a; return dfs(0, 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...