제출 #991486

#제출 시각아이디문제언어결과실행 시간메모리
991486fv3비스킷 담기 (IOI20_biscuits)C++14
9 / 100
122 ms436 KiB
#include <bits/stdc++.h> #include "biscuits.h" using namespace std; typedef long long ll; ll count_tastiness(ll X, vector<ll> A) { if (X > 100000ll) return 1; // O(10⁵) ll res = 0; for (ll y = 0; y < (100000 / X); y++) { vector<ll> a = A; bool p = true; for (int i = 0; i < X; i++) { ll v = 0; for (ll j = a.size() - 1; j >= 0; j--) { ll n = min(a[j], (y - v) / (1ll << j)); v += n * (1 << j); a[j] -= n; } if (v != y) { p = false; break; } } p&&res++; } return res; }
#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...