제출 #1130619

#제출 시각아이디문제언어결과실행 시간메모리
1130619lopkusA Plus B (IOI23_aplusb)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>

#define int long long

#include "aplusb.h"

using namespace std;

std::vector<int> smallest_sums(int N, std::vector<int> A, std::vector<int> B) {
	set<pair<int, pair<int,int> > >s;
    s.insert({A[0] + B[0], {0, 0}});
    vector<int> ans;
    while(ans.size() != N) {
        int u = (*s.begin()).first;
        int i = (*s.begin()).second.first;
        int j = (*s.begin()).second.second;
        auto it = s.begin();
        s.erase(it);
        ans.push_back(u);
        if(i + 1 < N) {
            s.insert({A[i + 1]+ B[j], {i + 1 , j}});
        }
        if(j + 1 < N) {
            s.insert({A[i] + B[j + 1], {i, j + 1}});
        }
    }
    return ans;
}

/*
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    for(auto it : smallest_sums(3, {0, 2, 2}, {3, 5, 6})) {
        cout << it << " ";
    }
}*/

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

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