Submission #613378

#TimeUsernameProblemLanguageResultExecution timeMemory
613378penguinhackerPacking Biscuits (IOI20_biscuits)C++17
42 / 100
1072 ms15692 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define ar array ll count_tastiness(ll x, vector<ll> a) { map<ll, ll> dp; dp[0]=1; for (int i=0; i<a.size()||dp.size()>1||dp.begin()->first; ++i) { map<ll, ll> dp2; for (auto b : dp) { ll cur=b.first+(i<a.size()?a[i]:0); dp2[cur/2]+=b.second; if (cur>=x) dp2[(cur-x)/2]+=b.second; } swap(dp, dp2); } return dp[0]; }

Compilation message (stderr)

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:11:17: 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()||dp.size()>1||dp.begin()->first; ++i) {
      |                ~^~~~~~~~~
biscuits.cpp:14:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |    ll cur=b.first+(i<a.size()?a[i]:0);
      |                    ~^~~~~~~~~
#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...