제출 #581729

#제출 시각아이디문제언어결과실행 시간메모리
581729joelau비스킷 담기 (IOI20_biscuits)C++14
9 / 100
82 ms340 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; vector<long long> A; long long count_tastiness(long long x, vector<long long> a) { while (a.size() < 20) a.push_back(0); long long ans = 0; for (long long i = 0; i*x <= 100000; ++i) { A = a; bool can = true; for (long long j = 0; j < A.size() && can; ++j) { if (i & (1ll<<j)) { if (A[j] >= x) A[j] -= x; else can = false; } if (j != A.size()-1) A[j+1] += A[j]/2; } if (can) ans++; } return ans; }

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

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:13:27: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |   for (long long j = 0; j < A.size() && can; ++j) {
      |                         ~~^~~~~~~~~~
biscuits.cpp:18:10: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |    if (j != A.size()-1) A[j+1] += A[j]/2;
      |        ~~^~~~~~~~~~~~~
#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...