Submission #673318

#TimeUsernameProblemLanguageResultExecution timeMemory
673318HanksburgerPacking Biscuits (IOI20_biscuits)C++17
Compilation error
0 ms0 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; map<long long, long long> mp; long long s[60], x; long long f(long long n) { if (n<=0 || mp[n]) return mp[n]; long long m=n-1, l=0; while (m/=2) l++; return mp[n]=f(1LL<<l)+f(min(n, 1+s[l]/x)-(1LL<<l)); } long long count_tastiness(long long X, vector<long long> A) { mp.clear(); x=X, mp[1]=1, s[0]=A[0]; for (long long i=1; i<A.size(); i++) s[i]=s[i-1]+(A[i]<<i); for (long long i=A.size(); i<60; i++) s[i]=s[i-1]; return f(

Compilation message (stderr)

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:19:23: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |  for (long long i=1; i<A.size(); i++)
      |                      ~^~~~~~~~~
biscuits.cpp:23:13: error: expected primary-expression at end of input
   23 |     return f(
      |             ^
biscuits.cpp:23:14: error: expected ';' at end of input
   23 |     return f(
      |             ~^
      |              ;
biscuits.cpp:23:13: error: expected '}' at end of input
   23 |     return f(
      |             ^
biscuits.cpp:16:1: note: to match this '{'
   16 | {
      | ^