Submission #695027

#TimeUsernameProblemLanguageResultExecution timeMemory
695027garam1732Packing Biscuits (IOI20_biscuits)C++14
0 / 100
2 ms340 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; long long count_tastiness(long long x, std::vector<long long> a) { for(int i = 0; i < a.size(); i++) { if(a[i] > 1) { if(i+1 == a.size()) a.push_back(a[i]>>1); else a[i+1] += a[i]>>1; a[i] &= 1; } } ll res = 1; for(ll x : a) if(x) res <<= 1; return res; }

Compilation message (stderr)

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