Submission #305714

#TimeUsernameProblemLanguageResultExecution timeMemory
305714arthurconmyPacking Biscuits (IOI20_biscuits)C++14
0 / 100
1080 ms384 KiB
#ifndef ARTHUR_LOCAL #include "biscuits.h" #endif #ifdef ARTHUR_LOCAL #include <bits/stdc++.h> #endif using namespace std; using ll = long long; ll count_tastiness(ll x, vector<ll> A) { ll ans = 0LL; for(int i=0; i<=100000; i++) { vector<ll> curA = A; bool w=1; for(int b=0; b<20; b++) { if((i & (1<<b)) != 0) { if(b >= A.size()) w=0; else { if(curA[b] < x) w=0; else curA[b] -= x; } } if(i+1 < A.size()) curA[i+1] += ll(curA[i]/2LL); } if(w) ans++; } return ans; }

Compilation message (stderr)

biscuits.cpp: In function 'll count_tastiness(ll, std::vector<long long int>)':
biscuits.cpp:25:10: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |     if(b >= A.size()) w=0;
      |        ~~^~~~~~~~~~~
biscuits.cpp:34:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |    if(i+1 < A.size()) curA[i+1] += ll(curA[i]/2LL);
      |       ~~~~^~~~~~~~~~
#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...