제출 #574777

#제출 시각아이디문제언어결과실행 시간메모리
574777RealSnakeA Difficult(y) Choice (BOI21_books)C++14
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h" using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; #define ll long long #define mod 1000000007 void solve(int n, int k, ll A, int s) { // s = n; ll pre[n + 1]; pre[0] = 0; for(int i = 1; i <= n; i++) { pre[i] = skim(i); pre[i] += pre[i - 1]; } vector<int> ans; for(int i = 1; i + k - 1 <= n; i++) { ll sum = pre[i + k - 1] - pre[i - 1]; if(sum >= A && sum <= 2 * A) { for(int j = i; j <= i + k - 1; j++) ans.push_back(j); answer(ans); return; } } impossible(); }

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

books.cpp: In function 'void solve(int, int, long long int, int)':
books.cpp:17:18: error: 'skim' was not declared in this scope
   17 |         pre[i] = skim(i);
      |                  ^~~~
books.cpp:26:13: error: 'answer' was not declared in this scope
   26 |             answer(ans);
      |             ^~~~~~
books.cpp:30:5: error: 'impossible' was not declared in this scope
   30 |     impossible();
      |     ^~~~~~~~~~