제출 #1189427

#제출 시각아이디문제언어결과실행 시간메모리
1189427theyeia나일강 (IOI24_nile)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pl = pair<ll,ll>;
using vl = vector<ll>;
const int MOD = 1e9 + 7;
#define F first
#define S second
#define sor(x) sort(begin(x), end(x))
#define FOR(i, a, b) for (int i = a; i < b; i++)

ll n, q;
ll preans = 0;

vector<tuple<ll,ll,ll>> Artifacts;
vector<tuple<ll,ll,ll>> Raw;
vector<pl> Queries;
vl Ans;

void find() {

}

void unite() {

}

vl calculate_costs (vl W, vl A, vl B, vl E) {
    ll n = W.size(), q = E.size();

    Ans.resize(q, 0);

    FOR(i, 0, n) {
        ll w = W[i], a = A[i], b = B[i];

        preans += b;
        Artifacts.push_back({w, a - b, i});
        Raw.push_back({w, a, b});
    }
    sor(Artifacts);

    FOR(i, 0, q) {
        ll e = E[i];
        Queries.push_back({e, i});
    }
    sor(Queries);

    

    FOR(i, 0, q) {
        ll d = Queries[i].F;
        ll j = Queries[i].S;

        ll lost = 0;

        if (n % 2) {
            lost = 1e9;
            FOR(i, 0, n) lost = min(lost, get<1>(Artifacts[i]));
        }

        Ans[j] = preans + lost;
    }

    return Ans;
}

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

/usr/bin/ld: /tmp/ccMZtFKA.o: in function `main':
grader.cpp:(.text.startup+0x30e): undefined reference to `calculate_costs(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status