제출 #560510

#제출 시각아이디문제언어결과실행 시간메모리
560510AlperenT비스킷 담기 (IOI20_biscuits)C++17
9 / 100
1131 ms1079784 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; long long count_tastiness(long long x, vector<long long> arr){ vector<long long> prv, cur; while(!arr.empty() && arr.back() == 0) arr.pop_back(); cur.push_back(0); int k = 0; while(true){ bool flag = false; for(auto i : cur) if(i != 0) flag = true; if(flag || k < arr.size()){ prv = cur; cur.clear(); long long cnt = k < arr.size() ? arr[k] : 0; for(auto i : prv){ cur.push_back(i / 2 + cnt); if(i / 2 + cnt - x >= 0) cur.push_back(i / 2 + cnt - x); } } else break; k++; } return cur.size(); }

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

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:20:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |   if(flag || k < arr.size()){
      |              ~~^~~~~~~~~~~~
biscuits.cpp:23:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |    long long cnt = k < arr.size() ? arr[k] : 0;
      |                    ~~^~~~~~~~~~~~
#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...