제출 #479253

#제출 시각아이디문제언어결과실행 시간메모리
479253khoabright비스킷 담기 (IOI20_biscuits)C++17
44 / 100
224 ms3836 KiB
#include <bits/stdc++.h> using namespace std; //#define int long long #define ff first #define ss second #define pii pair<int, int> #define all(x) x.begin(), x.end() #define rep(i, a, b) for (int i = (int)a; i <= (int)b; ++i) #define rep1(i, a, b) for (int i = (int)a; i >= (int)b; --i) #define mp make_pair #define vii vector<vector<int>> #define ll long long ll A[220000]; ll count_tastiness(ll x, vector<ll> a) { int sz = 0; while (a.size() < 61) a.push_back(0); vector<ll> s(61); rep(i, 0, 60) { if (i) s[i] = s[i - 1]; s[i] += a[i] * (1ll << i); } A[sz++] = 0; rep(i, 1, 60) { ll mx = s[i - 1] / x; ll base = (1ll << (i - 1)); for (int j = 0; base + A[j] <= mx; ++j) { if (base + A[j] >= (1ll << i)) break; A[sz++] = base + A[j]; } } return sz; }
#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...