제출 #1207132

#제출 시각아이디문제언어결과실행 시간메모리
1207132tkm_algorithmsPacking Biscuits (IOI20_biscuits)C++20
0 / 100
60 ms408 KiB
/** * In the name of Allah * We are nothing and you're everything **/ #include <bits/stdc++.h> #include "biscuits.h" using namespace std; using ll = long long; #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() //#define int long long const char nl = '\n'; const int max_sum = 1e5; ll count_tastiness(ll x, vector<ll> a) { int k = sz(a); if (x > max_sum)return 1; auto check = [&](int y) { vector<ll> onki = a; int rep = x; while (rep--) { int want = y; for (int t = k-1; t >= 0; --t) { int d = min(want/(1ll<<t), a[t]); a[t] -= d; want -= (1ll<<t)*d; } if (want > 0)return false; } a = onki; return true; }; int res = 0; for (int i = 0; i*x <= max_sum; ++i)res += check(i); return res; } //int32_t main() { //ios::sync_with_stdio(0); //cin.tie(0); //cout << count_tastiness(3, {5, 2, 1}); //return 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...