제출 #416452

#제출 시각아이디문제언어결과실행 시간메모리
416452SuhaibSawalha1비스킷 담기 (IOI20_biscuits)C++17
9 / 100
1074 ms324 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; long long count_tastiness(long long x, vector<long long> a) { long long ans = 0; for (int i = 0; i <= 100000; ++i) { long long hv = 0; bool ok = 1; for (int j = 0; j < 20; ++j) { hv /= 2; if (j < a.size()) { hv += a[j]; } if (i >> j & 1) { if (hv >= x) { hv -= x; } else { ok = 0; break; } } } ans += ok; } return ans; }

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

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:12:10: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |    if (j < 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...