제출 #796960

#제출 시각아이디문제언어결과실행 시간메모리
796960vjudge1비스킷 담기 (IOI20_biscuits)C++17
0 / 100
1075 ms340 KiB
#include "biscuits.h" #include<algorithm> long long count_tastiness(long long x, std::vector<long long> a) { int ans = 0, sum = 0; for(int i = 0; i < a.size(); i++) { sum+=a[i]<<i; } for(int y = 0; y <= sum/x; y++) { std::vector<long long> a2 = a; for(int i = 0; i < x; i++) { long long rem=y; for(int j = a.size(); j--;) { int need = std::min(a2[j], rem>>j); rem-=need<<j; a2[j]-=need; } if(rem) break; if(i==x-1) ans++; } } return ans; }

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

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:5:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    5 |     for(int i = 0; i < a.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...