Submission #405790

#TimeUsernameProblemLanguageResultExecution timeMemory
405790ly20Packing Biscuits (IOI20_biscuits)C++17
0 / 100
1088 ms332 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; const int MAXN = 40, INF = 1e9; int mc[MAXN]; long long count_tastiness(long long x, vector<long long> a) { long long resp = 0; for(int j = 0; j <= 100000; j++) { for(int i = 0; i < a.size(); i++) { mc[i] = a[i]; } bool ok = true; for(int i = 0; i < 32; i++) { if((1 << i) & j) { if(mc[i] < x) { ok = false; break; } mc[i] -= x; } mc[i + 1] += mc[i] / 2; } if(ok) resp++; } return resp; }

Compilation message (stderr)

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:12:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |         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...