Submission #552107

#TimeUsernameProblemLanguageResultExecution timeMemory
552107nekiPacking Biscuits (IOI20_biscuits)C++14
0 / 100
10 ms392 KiB
#include <bits/stdc++.h> using namespace std; #define vc vector #define ll long long #define loop(i, a, b) for(ll i=a;i<b;++i) #define pool(i, a, b) for(ll i=a-1;i>=b;--i) long long count_tastiness(long long x, vc<long long> a){ ll mk=62; a.resize(mk); vc<ll> dp(mk); for(ll i=0, j=0;i<mk;++i, j=i-1){ while(j>=0 and j<i and a[i]<x){ ll rpot=((ll)1 << (i-j)), kok=min(max((ll)0, x-a[i]), a[j]/rpot); a[i]+=kok, a[j]-=kok * rpot; --j; } } return dp[mk-1]; }
#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...