제출 #1368087

#제출 시각아이디문제언어결과실행 시간메모리
1368087takoshanavaArt Collections (BOI22_art)C++20
컴파일 에러
0 ms0 KiB
//#include "art.h"
#include <bits/stdc++.h>
#define pb push_back
#define fs first
#define sc second
using namespace std;

void solve(int n){
    vector<int> vec;
    for(int i = 1; i <= n; i++) vec.pb(i);
    vector<int> c(n);
    for(int i = 0; i < n; i++){
        c[i] = publish(vec);
        vec.pb(vec[0]);
        vec.erase(vec.begin());
    }
    c.pb(c[0]);
    vector<int> ans(n);
    for(int i = 0; i < n; i++){
        int a = c[i], b = c[i + 1];
        int y = (a + b - n + 1) / 2;
        int x = a - y;
        ans[x] = i + 1;
    }
    answer(ans);
}

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

art.cpp: In function 'void solve(int)':
art.cpp:13:16: error: 'publish' was not declared in this scope
   13 |         c[i] = publish(vec);
      |                ^~~~~~~
art.cpp:25:5: error: 'answer' was not declared in this scope
   25 |     answer(ans);
      |     ^~~~~~