Submission #552064

#TimeUsernameProblemLanguageResultExecution timeMemory
552064nekiPacking Biscuits (IOI20_biscuits)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define vc vector #define ll __int128 #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) ll min(ll a, ll b){return (a>b) ? b:a;} long long count_tastiness(ll x, vc<ll> A){ ll k=A.size(); ll mk=124; vc<ll> a(mk); loop(i, 0, k) a[i+1]=A[i]; vc<ll> dp(mk, 0);dp[0]=1; loop(ti, 1, mk){ dp[ti]=dp[ti-1]; if(a[ti]>=x) dp[ti]+=dp[ti-1]; else{ ll i=ti; vc<ll> na=a; pool(j, ti, 1){ ll rpot=((ll)1<<(i-j)); ll kok=min((x-na[i]) * rpot, na[j]- na[j]%rpot); na[i]+=kok/rpot; na[j]-=kok; if(x>na[i]) na[j-1]+=2 * na[j]; else{ if(na[j]>=x){dp[ti]+=dp[j];break;} else{ dp[ti]+=dp[j-1]; i=j; } } } } } return (long long ) dp[mk-1]; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccTtyabB.o: in function `main':
grader.cpp:(.text.startup+0x487): undefined reference to `count_tastiness(long long, std::vector<long long, std::allocator<long long> >)'
collect2: error: ld returned 1 exit status