Submission #675713

#TimeUsernameProblemLanguageResultExecution timeMemory
675713VodkaInTheJarPacking Biscuits (IOI20_biscuits)C++14
9 / 100
1131 ms1051068 KiB
#include <bits/stdc++.h> #pragma GCC optimize("O3") #define endl '\n' using namespace std; long long count_tastiness(long long x, vector <long long> a) { vector <long long> v; v.push_back(0); int sz = (int)a.size(); for (int i = 0; ; i++) { for (auto &j: v) j >>= 1ll; if (i < sz) for (auto &j: v) j += a[i]; int old_sz = (int)v.size(); for (int j = 0; j < old_sz; j++) if (v[j] >= x) v.push_back(v[j] - x); if ((int)v.size() == old_sz && i >= sz) break; } return (int)v.size(); } /* int main() { long long x, n; cin >> x >> n; vector <long long> a(n); for (int i = 0; i < n; i++) cin >> a[i]; cout << count_tastiness(x, a) << endl; } */
#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...