Submission #418732

#TimeUsernameProblemLanguageResultExecution timeMemory
4187322qbingxuanPacking Biscuits (IOI20_biscuits)C++14
9 / 100
1093 ms1100 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; long long dfs(vector<long long> &a, long long x, int i, long long carry) { if (i == a.size()) { return carry / x + 1; } carry += a[i]; long long res = 0; res += dfs(a, x, i+1, carry / 2); // y >> i & 1 == 0 if (carry >= x) { res += dfs(a, x, i+1, (carry - x) / 2); } return res; } long long count_tastiness(long long x, std::vector<long long> a) { return dfs(a, x, 0, 0); }

Compilation message (stderr)

biscuits.cpp: In function 'long long int dfs(std::vector<long long int>&, long long int, int, long long int)':
biscuits.cpp:6:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 |     if (i == a.size()) {
      |         ~~^~~~~~~~~~~
#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...