Submission #800584

#TimeUsernameProblemLanguageResultExecution timeMemory
800584FEDIKUSPacking Biscuits (IOI20_biscuits)C++17
42 / 100
1066 ms23900 KiB
#include "biscuits.h" #include<bits/stdc++.h> using namespace std; using ll = long long; ll count_tastiness(ll x, vector<ll> a){ map<ll,ll> da; da[0]=1; for(int i=0;i<60;i++) a.push_back(0); for(int i=0;i<a.size();i++){ map<ll,ll> nov; for(auto j:da){ nov[(j.first+a[i])/2]+=j.second; if(j.first+a[i]>=x) nov[(j.first+a[i]-x)/2]+=j.second; } da=nov; } ll ret=0; for(auto i:da) ret+=i.second; return ret; }

Compilation message (stderr)

biscuits.cpp: In function 'll count_tastiness(ll, std::vector<long long int>)':
biscuits.cpp:11:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |  for(int i=0;i<a.size();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...