제출 #944326

#제출 시각아이디문제언어결과실행 시간메모리
944326bngybongybrdA 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 diff[100005];

    if(skim(1)*3 > 2*A){impossible();}
    if(skim(N)*K < A){impossible();}
    for(int i = 1; i <= S; i++){diff[i-1] = skim(i);}
    int sum = 0;
    
    for(int i = 0; i < S; i++){
        sum = 0;
        sum += diff[i];
        for(int j = i+1; j < S; j++){
            for(int x = j+1; x < S; x++){
                sum += diff[j];
                sum += diff[x];
                if(sum >= A and sum <= 2*A){
                    answer({i, j, x});
                }
            }
        }
    }
    impossible();
}

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

books.cpp: In function 'void solve(int, int, long long int, int)':
books.cpp:10:8: error: 'skim' was not declared in this scope
   10 |     if(skim(1)*3 > 2*A){impossible();}
      |        ^~~~
books.cpp:10:25: error: 'impossible' was not declared in this scope
   10 |     if(skim(1)*3 > 2*A){impossible();}
      |                         ^~~~~~~~~~
books.cpp:11:8: error: 'skim' was not declared in this scope
   11 |     if(skim(N)*K < A){impossible();}
      |        ^~~~
books.cpp:11:23: error: 'impossible' was not declared in this scope
   11 |     if(skim(N)*K < A){impossible();}
      |                       ^~~~~~~~~~
books.cpp:12:45: error: 'skim' was not declared in this scope
   12 |     for(int i = 1; i <= S; i++){diff[i-1] = skim(i);}
      |                                             ^~~~
books.cpp:23:21: error: 'answer' was not declared in this scope
   23 |                     answer({i, j, x});
      |                     ^~~~~~
books.cpp:28:5: error: 'impossible' was not declared in this scope
   28 |     impossible();
      |     ^~~~~~~~~~