Submission #1033415

#TimeUsernameProblemLanguageResultExecution timeMemory
1033415Maite_MoralePacking Biscuits (IOI20_biscuits)C++14
0 / 100
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; long long count_tastiness(long long x, std::vector<long long> a) { long long c=0; std::vector<long long> t={1}; for(long long i=0;i<64;i++){ t.push_back(t.back()); if(i<a.size())c+=(a[i]<<i); long long h=c/x-(1LL<<i); long long r=0; if(h>=0){ if(h==0)r=t[0]; else { long long lg=log2(h)+1LL; r+=t[min(lg,i)]; } } t[i+1]+=r; } return t[64]; }

Compilation message (stderr)

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:9:7: 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]
    9 |   if(i<a.size())c+=(a[i]<<i);
      |      ~^~~~~~~~~
#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...