Submission #480064

#TimeUsernameProblemLanguageResultExecution timeMemory
480064couplefirePacking Biscuits (IOI20_biscuits)C++17
0 / 100
1143 ms1051060 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int count_tastiness(int x, vector<int> cnt){ vector<int> dp = {0}; int hi = 0; for(int i = 0; i<cnt.size(); ++i){ hi += cnt[i]*(1<<i); for(int j = 0, s = min((__int128)x*(1<<i), (__int128)2e18), m = dp.size(); j<m && dp[j]+s<=hi; ++j) dp.push_back(dp[j]+s); } return dp.size(); }

Compilation message (stderr)

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:7:21: 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]
    7 |     for(int i = 0; i<cnt.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...