Submission #581748

#TimeUsernameProblemLanguageResultExecution timeMemory
581748joelauPacking Biscuits (IOI20_biscuits)C++14
12 / 100
6 ms380 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; vector<long long> A; map<long long,long long> memo[65]; long long dp(long long n, long long x) { if (n == 60) return 1; if (memo[n].find(x) != memo[n].end()) return memo[n][x]; long long ans = dp(n+1,A[n+1]+x/2); if (x != 0) ans += dp(n+1,A[n+1]+(x-1)/2); return memo[n][x] = ans; } long long count_tastiness(long long x, vector<long long> a) { while (a.size() < 65) a.push_back(0); A = a; for (long long i = 0; i < 65; ++i) memo[i].clear(); return dp(0,A[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...