제출 #834067

#제출 시각아이디문제언어결과실행 시간메모리
834067finn__비스킷 담기 (IOI20_biscuits)C++17
9 / 100
1043 ms340 KiB
#include <bits/stdc++.h> #include "biscuits.h" using namespace std; constexpr size_t N = 60; using L = long long; L count_tastiness(L x, std::vector<L> a) { a.resize(19); size_t ans = 0; for (size_t i = 0; i <= 100000; ++i) { size_t leftover = 0; bool possible = 1; for (size_t j = 0; j < 19; ++j) { leftover >>= 1; if (i & (1 << j)) { possible &= leftover + a[j] >= x; if (!possible) break; leftover = leftover + a[j] - x; } else { leftover += a[j]; } } ans += possible; } return ans; }

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

biscuits.cpp: In function 'L count_tastiness(L, std::vector<long long int>)':
biscuits.cpp:24:45: warning: comparison of integer expressions of different signedness: 'long long unsigned int' and 'L' {aka 'long long int'} [-Wsign-compare]
   24 |                 possible &= leftover + a[j] >= x;
      |                             ~~~~~~~~~~~~~~~~^~~~
#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...