제출 #1186218

#제출 시각아이디문제언어결과실행 시간메모리
1186218qwushaArt Collections (BOI22_art)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef long double ld;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
int inf = 1e15;

#include "art.h"

void solve(int n) {
    vector<int> a1(n), a2(n);
    vector<pair<int, int>> s;
    for (int i = 0; i < n; i++) {
        a1[0] = i + 1;
        int cur = 1;
        for (int j = 0; j < n; j++) {
            if (j == i)
                continue;
            a1[cur] = j + 1;
            cur++;
        }
        a2[n - 1] = i + 1;
        cur = 0;
        for (int j = 0; j < n; j++) {
            if (j == i)
                continue;
            a2[cur] = j + 1;
            cur++;
        }
        int k = publish(a1);
        int m = publish(a2);
        int val = (k - m + n - 1) / 2;
        s.push_back({val, i});
    }
    sort(s.begin(), s.end());
    vector<int> res;
    for (int i = 0; i < n; i++) {
        res.push_back(s[i].se + 1);
    }
    answer(res);
}

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

/usr/bin/ld: /tmp/ccz7HfbF.o: in function `solve(long long)':
art.cpp:(.text+0x6d1): undefined reference to `publish(std::vector<long long, std::allocator<long long> >)'
/usr/bin/ld: art.cpp:(.text+0x785): undefined reference to `publish(std::vector<long long, std::allocator<long long> >)'
/usr/bin/ld: art.cpp:(.text+0xb50): undefined reference to `answer(std::vector<long long, std::allocator<long long> >)'
/usr/bin/ld: /tmp/ccxHtuIe.o: in function `main':
interface.cpp:(.text.startup+0x16): undefined reference to `solve(int)'
collect2: error: ld returned 1 exit status