Submission #605420

#TimeUsernameProblemLanguageResultExecution timeMemory
605420Tigryonochekk비스킷 담기 (IOI20_biscuits)C++17
0 / 100
1 ms340 KiB
#include <iostream> #include "biscuits.h" #include <vector> #include <map> #define ll long long #define pll pair<ll, ll> using namespace std; const int K = 62; long long count_tastiness(long long x, vector<long long> a) { map<ll, ll> dp0, dp1; int k = a.size(); dp0[a[0]] = 1; if (a[0] > x) { dp0[a[0] - x] = 1; } for (int i = 0; i < k - 1; i++) { for (auto jt = dp0.begin(); jt != dp0.end(); jt++) { pll wtf = *jt; ll j = wtf.second; dp1[j / 2 + a[i + 1]] += dp0[j]; if (j > x) { dp1[(j - x) / 2 + a[i + 1]] += dp0[j]; } } } ll ans = 0; for (auto it = dp1.begin(); it != dp1.end(); it++) { ans += (*it).second; } return ans; }
#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...