#include "aplusb.h"
#include<bits/stdc++.h>
using namespace std;
std::vector<int> smallest_sums(int N, std::vector<int> A, std::vector<int> B) {
priority_queue <tuple <int long long, int, int>> pq;
pq.push({-A[0]-B[0], 0, 0});
vector <int long long> ans;
for(int i = 0;i < N;i++){
auto [v, l, r] = pq.top();
pq.pop();
v *= -1;
ans.push_back(v);
pq.push({-A[l]-B[r+1], l, r+1});
pq.push({-A[l+1]-B[r], l+1, r});
}
return ans;
}
Compilation message
aplusb.cpp: In function 'std::vector<int> smallest_sums(int, std::vector<int>, std::vector<int>)':
aplusb.cpp:23:9: error: could not convert 'ans' from 'vector<long long int>' to 'vector<int>'
23 | return ans;
| ^~~
| |
| vector<long long int>