Submission #338319

#TimeUsernameProblemLanguageResultExecution timeMemory
338319mayflyyhPacking Biscuits (IOI20_biscuits)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #define ll long long ll dp[70]; ll b[70]; ll count_tastiness(ll x, ll[] a){ int end=65; for(int i=0;i<=end;++i) if(a[i]) b[i]=a[i]; else b[i]=0; for(int i=end;i+1;--i){ if(i==end){ dp[i]=1; } else{ for(int j=end;j>=i+1;--j){ ll min=0,max=(1<<end-i)-1; ll ai=0; for(int k=j-1;k>=i;--k){ ai=ai*2+b[i]; ll y_=0; if(k>i){ y_=(ai/x+1)<<(k-i); if(y_>min) min=y_; } else{ y_=ai/x; if(y_<max) max=y_; } } } } } return dp[0]; }

Compilation message (stderr)

biscuits.cpp:5:31: error: expected ',' or '...' before 'a'
    5 | ll count_tastiness(ll x, ll[] a){
      |                               ^
biscuits.cpp: In function 'long long int count_tastiness(long long int, long long int*)':
biscuits.cpp:8:6: error: 'a' was not declared in this scope
    8 |   if(a[i]) b[i]=a[i];
      |      ^
biscuits.cpp:16:25: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   16 |     ll min=0,max=(1<<end-i)-1;
      |                      ~~~^~