제출 #672788

#제출 시각아이디문제언어결과실행 시간메모리
672788tbzard비스킷 담기 (IOI20_biscuits)C++14
44 / 100
198 ms3564 KiB
#include <bits/stdc++.h> using namespace std; long long ans[200002]; long long count_tastiness(long long x, vector<long long> a){ long long b = 1, sum = 0; for(int j=0;j<=200000;j++) ans[j] = 1e18+1; int l = 0; ans[l++] = 0; for(int i=0;i<60;i++){ if(i<a.size()) sum += b*a[i]; int m = upper_bound(ans, ans+l, sum/x-b)-ans-1; for(int j=0;j<=m;j++) ans[l++] = ans[j]+b; b*=2; } return l; }

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

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:10:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |         if(i<a.size()) sum += b*a[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...