Submission #1205687

#TimeUsernameProblemLanguageResultExecution timeMemory
1205687wpdmd76A Plus B (IOI23_aplusb)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; #define all(v) v.begin(), v.end() #include "aplusb.h" vector<ll> smallest_sums(int N, vector<int> a, vector<int> b) { vector<ll> res; int st = 0, en = 0; priority_queue<array<ll,3>,vector<array<ll,3>>,greater<array<ll,3>>> pq; pq.push({a[st] + b[en], st, en}); while(true){ auto[x, i, j] = pq.top(); pq.pop(); res.push_back(x); pq.push({a[i + 1] + b[j], i + 1, j}); pq.push({a[i] + b[j + 1], i, j + 1}); if(res.size() == N) break; } return {res}; }

Compilation message (stderr)

aplusb.cpp:7:12: error: ambiguating new declaration of 'std::vector<long long int> smallest_sums(int, std::vector<int>, std::vector<int>)'
    7 | vector<ll> smallest_sums(int N, vector<int> a, vector<int> b) {
      |            ^~~~~~~~~~~~~
In file included from aplusb.cpp:5:
aplusb.h:3:18: note: old declaration 'std::vector<int> smallest_sums(int, std::vector<int>, std::vector<int>)'
    3 | std::vector<int> smallest_sums(int N, std::vector<int> A, std::vector<int> B);
      |                  ^~~~~~~~~~~~~