제출 #772805

#제출 시각아이디문제언어결과실행 시간메모리
772805ImeonA Difficult(y) Choice (BOI21_books)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> //#include"books.h" using namespace std; void solve(int N, int K, long long A, int S) { int N, K, S , A; cin >> N >> K >> S >> A; vector<long long>x; long long x[N + 1]; long long sm = 0; int f = 0; for (int i = 1; i <= S + 1;i++){ x[i] = skim(i); sm += x[i]; f++; if (f > K){sm -= x[i - k - 1];} if (sm >= A and sm <= 2ll * A){ vector<int>v; for (int j = i - k; j <= i; j++){ v.push_back(j); } answer(v); } } imposibble() }

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

books.cpp: In function 'void solve(int, int, long long int, int)':
books.cpp:5:9: error: declaration of 'int N' shadows a parameter
    5 |     int N, K, S , A;
      |         ^
books.cpp:4:16: note: 'int N' previously declared here
    4 | void solve(int N, int K, long long A, int S) {
      |            ~~~~^
books.cpp:5:12: error: declaration of 'int K' shadows a parameter
    5 |     int N, K, S , A;
      |            ^
books.cpp:4:23: note: 'int K' previously declared here
    4 | void solve(int N, int K, long long A, int S) {
      |                   ~~~~^
books.cpp:5:15: error: declaration of 'int S' shadows a parameter
    5 |     int N, K, S , A;
      |               ^
books.cpp:4:43: note: 'int S' previously declared here
    4 | void solve(int N, int K, long long A, int S) {
      |                                       ~~~~^
books.cpp:5:19: error: declaration of 'int A' shadows a parameter
    5 |     int N, K, S , A;
      |                   ^
books.cpp:4:36: note: 'long long int A' previously declared here
    4 | void solve(int N, int K, long long A, int S) {
      |                          ~~~~~~~~~~^
books.cpp:9:15: error: conflicting declaration 'long long int x [(N + 1)]'
    9 |     long long x[N + 1];
      |               ^
books.cpp:8:22: note: previous declaration as 'std::vector<long long int> x'
    8 |     vector<long long>x;
      |                      ^
books.cpp:13:16: error: 'skim' was not declared in this scope; did you mean 'sm'?
   13 |         x[i] = skim(i);
      |                ^~~~
      |                sm
books.cpp:16:32: error: 'k' was not declared in this scope
   16 |         if (f > K){sm -= x[i - k - 1];}
      |                                ^
books.cpp:19:30: error: 'k' was not declared in this scope
   19 |             for (int j = i - k; j <= i; j++){
      |                              ^
books.cpp:22:13: error: 'answer' was not declared in this scope
   22 |             answer(v);
      |             ^~~~~~
books.cpp:25:9: error: 'imposibble' was not declared in this scope
   25 |         imposibble()
      |         ^~~~~~~~~~