제출 #865425

#제출 시각아이디문제언어결과실행 시간메모리
865425AlebnA Difficult(y) Choice (BOI21_books)C++14
0 / 100
4 ms1228 KiB
#include <iostream> #include <vector> #include "books.h" #define ll long long #define ull unsigned long long using namespace std; void solve(int n, int k, ll A, int S) { vector<ull> a(n); bool ok = false; ull sum = 0; int mid = -1; for(int i = 0; i < n; i++) { a[i] = skim(i+1); if(a[i] >= A && mid == -1) mid = i; } for(int i = 0; i < k-1; i++) sum+=a[i]; mid = max(mid, k-1); for(int i = mid; i > k-2; i--) { if(sum+a[i] >= A && sum+a[i] <= 2*A) { vector<int> b(k); for(int j = 0; j < k-1; j++) b[j] = j+1; b[k-1] = i+1; answer(b); return; ok = true; } } if(!ok) impossible(); }

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

books.cpp: In function 'void solve(int, int, long long int, int)':
books.cpp:17:17: warning: comparison of integer expressions of different signedness: '__gnu_cxx::__alloc_traits<std::allocator<long long unsigned int>, long long unsigned int>::value_type' {aka 'long long unsigned int'} and 'long long int' [-Wsign-compare]
   17 |         if(a[i] >= A && mid == -1) mid = i;
books.cpp:22:21: warning: comparison of integer expressions of different signedness: 'long long unsigned int' and 'long long int' [-Wsign-compare]
   22 |         if(sum+a[i] >= A && sum+a[i] <= 2*A) {
      |            ~~~~~~~~~^~~~
books.cpp:22:38: warning: comparison of integer expressions of different signedness: 'long long unsigned int' and 'long long int' [-Wsign-compare]
   22 |         if(sum+a[i] >= A && sum+a[i] <= 2*A) {
      |                             ~~~~~~~~~^~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...