제출 #1236382

#제출 시각아이디문제언어결과실행 시간메모리
1236382alex_2008Packing Biscuits (IOI20_biscuits)C++20
0 / 100
1096 ms328 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; ll count_tastiness(ll x, vector<ll> a) { int sm = 0; for (int i = 0; i < (int)a.size(); i++) { sm += (1 << i) * a[i]; } while (!a.empty() && a.back() == 0) a.pop_back(); int ans = 0; for (int i = 0; i <= sm / x; i++) { bool ch = true; vector <ll> b = a; for (int j = 1; j <= x; j++) { int cur = i; for (int w = (int)b.size() - 1; w >= 0; w--) { if (cur == 0) break; int k = min(cur >> w, (int)b[w]); cur -= k * (1 << w); b[w] -= k; } if (cur != 0) { ch = false; break; } } if (ch) ans++; } 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...