제출 #996307

#제출 시각아이디문제언어결과실행 시간메모리
996307Muaath_5비스킷 담기 (IOI20_biscuits)C++17
0 / 100
1065 ms348 KiB
#include "biscuits.h" #define ll long long ll N; bool can(long long x, std::vector<long long> a) { for (int i = 0; i < 60; i++) { if (x>>i&1) { if (a.size() < i || a[i] < N) return false; a[i] -= N; if (i+1 < a.size()) a[i+1] += a[i]/2; } } return true; } long long count_tastiness(long long x, std::vector<long long> a) { a.push_back(0); N = x; ll sol = 1; for (int i = 1; i <= 200000; i++) { if (can(i, a)) sol++; } return sol; }

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

biscuits.cpp: In function 'bool can(long long int, std::vector<long long int>)':
biscuits.cpp:9:17: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    9 |    if (a.size() < i || a[i] < N) return false;
      |        ~~~~~~~~~^~~
biscuits.cpp:11:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |    if (i+1 < 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...