제출 #531918

#제출 시각아이디문제언어결과실행 시간메모리
5319184fectaA Difficult(y) Choice (BOI21_books)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "books.h" using namespace std; #define ll long long #define int ll #define ld long double #define pii pair<int, int> #define f first #define s second #define boost() cin.tie(0), cin.sync_with_stdio(0) int h[100005], in[100005]; void solve(int n, int k, int a, int s) { vector<int> ret; int sum = 0; for (int i = 1; i < k; i++) { h[i] = skim(i); sum += h[i]; in[i] = 1; } int lo = k, hi = n, mid; while (lo < hi) { mid = (lo + hi + 1) >> 1; h[mid] = skim(mid); if (sum + h[mid] > 2 * a) hi = mid - 1; else lo = mid; } in[lo] = 1; if (sum + h[lo] >= a) { for (int i = 0; i < 100005; i++) if (in[i]) ret.push_back(i); answer(ret); } for (int i = 1; i < k; i++) { h[lo - i] = skim(lo - i); sum += h[lo - i] - h[k - i]; in[lo - i] = 1, in[k - i] = 0; if (sum + h[lo] >= a) { for (int i = 0; i < 100005; i++) if (in[i]) ret.push_back(i); answer(ret); } } impossible(); } int32_t main() { boost(); return 0; }

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

books.cpp: In function 'void solve(long long int, long long int, long long int, long long int)':
books.cpp:32:16: error: could not convert 'ret' from 'vector<long long int>' to 'vector<int>'
   32 |         answer(ret);
      |                ^~~
      |                |
      |                vector<long long int>
books.cpp:40:20: error: could not convert 'ret' from 'vector<long long int>' to 'vector<int>'
   40 |             answer(ret);
      |                    ^~~
      |                    |
      |                    vector<long long int>