Submission #560503

#TimeUsernameProblemLanguageResultExecution timeMemory
560503AlperenTPacking Biscuits (IOI20_biscuits)C++17
0 / 100
2 ms340 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; long long count_tastiness(long long x, vector<long long> a){ vector<long long> prv, cur; while(!a.empty() && a.back() == 0) a.pop_back(); cur.push_back(0); for(int k = 0; k < a.size(); k++){ prv = cur; cur.clear(); for(auto i : prv){ cur.push_back(i / 2 + a[k]); if(i / 2 + a[k] >= x) cur.push_back(i / 2 + a[k] - x); } } return cur.size(); }

Compilation message (stderr)

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