Submission #390882

#TimeUsernameProblemLanguageResultExecution timeMemory
390882AlexPop28Packing Biscuits (IOI20_biscuits)C++14
0 / 100
1096 ms452 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; int n; long long Solve(int i, vector<long long> cnt) { if (i == (int)cnt.size()) { return 1LL; } if (cnt[i] < n) { return Solve(i + 1, cnt); } long long ret = Solve(i + 1, cnt); if (i + 1 == (int)cnt.size()) { cnt.emplace_back(0LL); } cnt[i + 1] += cnt[i] / 2; ret += Solve(i + 1, cnt); return ret; } long long count_tastiness(long long n, vector<long long> a) { ::n = n; for (int i = 0; i < (int)a.size(); ++i) { if (a[i] > n + 1) { if (i + 1 == (int)a.size()) a.emplace_back(0LL); a[i + 1] += (a[i] - n) / 2; } } return Solve(0, 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...