Submission #1130618

#TimeUsernameProblemLanguageResultExecution timeMemory
1130618lopkusA Plus B (IOI23_aplusb)C++20
Compilation error
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 << " "; } }*/

Compilation message (stderr)

/usr/bin/ld: /tmp/ccFWW2k1.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