Submission #582237

#TimeUsernameProblemLanguageResultExecution timeMemory
582237joelauPacking Biscuits (IOI20_biscuits)C++14
44 / 100
1132 ms1050992 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; vector<long long> ans; long long count_tastiness(long long x, vector<long long> a) { while (a.size() < 60) a.push_back(0); ans = {0}; long long sum = 0; for (long long i = 0; i < a.size(); ++i) { sum += a[i] * (1ll<< i); long long n = ans.size(); for (long long j = 0; j < n && ans[j] <= sum/x - (1ll<<i); ++j) ans.push_back(ans[j]+(1ll<<i)); } return ans.size(); }

Compilation message (stderr)

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:11:26: 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]
   11 |  for (long long 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...