Submission #376346

#TimeUsernameProblemLanguageResultExecution timeMemory
376346Jarif_RahmanPacking Biscuits (IOI20_biscuits)C++17
Compilation error
0 ms0 KiB
#include "biscuits.h" #include <bits/stdc++.h> #define pb push_back #define f first #define sc second using namespace std; typedef long long int ll; typedef ll __int128; typedef string str; const int kk = 125; ll count_tastiness(ll x, vector<ll> aa){ vector<__int128> a(kk); int k = aa.size(); for(int i = 0; i < k; i++) a[i] = aa[i]; ll ans = 0; vector<__int128> s(kk, 0); for(int i = 0; i < kk; i++){ if(i != 0) s[i] = s[i-1]; s[i]+=a[i]*(1LL<<i); } vector<__int128> v; v.pb({0}); for(int i = 0; i < kk; i++){ __int128 mx = s[i]/x-mx, p = 1; p<<=i; mx-=p; int in = upper_bound(v.begin(), v.end(), mx) - v.begin(); for(int j = 0; j < in; j++) v.pb(v[j]+p); } return v.size(); }

Compilation message (stderr)

biscuits.cpp:8:12: error: multiple types in one declaration
    8 | typedef ll __int128;
      |            ^~~~~~~~
biscuits.cpp:8:12: error: declaration does not declare anything [-fpermissive]
biscuits.cpp: In function 'll count_tastiness(ll, std::vector<long long int>)':
biscuits.cpp:15:8: warning: unused variable 'ans' [-Wunused-variable]
   15 |     ll ans = 0;
      |        ^~~