Submission #672779

#TimeUsernameProblemLanguageResultExecution timeMemory
672779tbzardPacking Biscuits (IOI20_biscuits)C++14
0 / 100
1 ms340 KiB
#include <bits/stdc++.h> using namespace std; set<long double> ans; long long count_tastiness(long long x, vector<long long> a){ int n = a.size(); ans.clear(); long double b = 1, sum = 0; ans.insert(0); for(int i=0;i<a.size();i++){ sum += b*a[i]; vector<long double> add; for(auto y:ans){ if(sum/x >= y+b){ add.push_back(y+b); } } for(int j=0;j<add.size();j++){ ans.insert(add[j]); } b *= 2; } return (long long)ans.size(); }

Compilation message (stderr)

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:11:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for(int i=0;i<a.size();i++){
      |                 ~^~~~~~~~~
biscuits.cpp:19:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long double>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |         for(int j=0;j<add.size();j++){
      |                     ~^~~~~~~~~~~
biscuits.cpp:6:9: warning: unused variable 'n' [-Wunused-variable]
    6 |     int n = 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...