제출 #829154

#제출 시각아이디문제언어결과실행 시간메모리
829154definitelynotmee비스킷 담기 (IOI20_biscuits)C++17
44 / 100
1138 ms1604972 KiB
#include "biscuits.h" //#include"grader.cpp" #include<bits/stdc++.h> #define ff first #define ss second #define all(x) x.begin(), x.end() using namespace std; using ll = long long; using pii = pair<int,int>; const ll INFL = 2e18; using pll = pair<ll,ll>; long long count_tastiness(long long x, std::vector<long long> a) { a.resize(60,0); int k = a.size(); vector<ll> ct(k); ct[0] = a[0]; for(int i = 1; i < k; i++){ ct[i] = a[i]*(1ll<<i)+ct[i-1]; } vector<ll> poss = {0}; poss.reserve(2e5); for(int i = 0; i < k; i++){ if((1ll<<i)*x >= INFL) break; int n = poss.size(); for(int j = 0; j < n; j++){ if(ct[i]-poss[j]*x >= (1ll<<i)*x) poss.push_back((1ll<<i)+poss[j]); else break; } } return poss.size(); }
#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...