제출 #1014827

#제출 시각아이디문제언어결과실행 시간메모리
1014827Unforgettablepl비스킷 담기 (IOI20_biscuits)C++17
0 / 100
1079 ms33092 KiB
#include <bits/stdc++.h> using namespace std; const int LIMIT = 18; long long count_tastiness(long long x, std::vector<long long> a) { map<pair<int,int>,long long> memo; function<long long(int,int)> calc = [&](int i,int j){ j=max(j,0); if(memo.count({i,j}))return memo[{i,j}]; if(i==-1)return j==0 ? 1ll : 0ll; return memo[{i,j}] = calc(i-1,2*(j-a[i]+x))+calc(i-1,2*(j-a[i])); // else return memo[{i,j}]=0ll; }; a.resize(LIMIT+1); return calc(LIMIT,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...