Submission #397169

#TimeUsernameProblemLanguageResultExecution timeMemory
397169rocks03Packing Biscuits (IOI20_biscuits)C++14
9 / 100
1106 ms394344 KiB
//#pragma GCC target("avx2") //#pragma GCC optimization("O3") //#pragma GCC optimization("unroll-loops") #include<bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> #define ff first #define ss second #define pb push_back #define SZ(x) ((int)(x).size()) #define all(x) x.begin(), x.end() #define rep(i, a, b) for(int i = (a); i < (b); i++) #define per(i, a, b) for(int i = (a); i >= (b); i--) mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int N; ll x; vector<ll> a; long long count_tastiness(long long X, vector<long long> A){ while(SZ(A) < 62) A.pb(0); a = A, x = X, N = SZ(A); rep(i, 0, N){ a[i] = a[i] * (1ll << i); if(i) a[i] += a[i - 1]; } ll ans = 1; vector<ll> v = {0}; rep(i, 0, N){ vector<ll> v2; for(ll y : v){ y += (1ll << i); if(a[i] / x >= y){ v2.pb(y); ans++; } } for(ll y : v2) v.pb(y); } 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...