제출 #672781

#제출 시각아이디문제언어결과실행 시간메모리
672781tbzard비스킷 담기 (IOI20_biscuits)C++14
9 / 100
1096 ms104084 KiB
#include <bits/stdc++.h> using namespace std; long long count_tastiness(long long x, vector<long long> a){ int n = a.size(); long double b = 1, sum = 0; set<long double> ans; ans.insert(0); for(int i=0;i<a.size();i++){ sum += b*a[i]; while(1){ vector<long double> add; set<long double>::reverse_iterator it; for(it = ans.rbegin(); it != ans.rend(); it++){ long long val = *it+(1ll<<i); if(sum/x >= val){ if(ans.find(val) != ans.end()){ break; } add.push_back(val); } } for(int j=0;j<add.size();j++){ ans.insert(add[j]); } if(add.empty()) break; } b *= 2; } return (long long)ans.size(); }

컴파일 시 표준 에러 (stderr) 메시지

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