Submission #1205695

#TimeUsernameProblemLanguageResultExecution timeMemory
1205695wpdmd76A 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<int> smallest_sums(int N, vector<int> a, vector<int> b) {
	vector<int> res;
	map<pair<ll,ll>, ll> vis;
	priority_queue<array<ll,3>,vector<array<ll,3>>,greater<array<ll,3>>> pq;
	pq.push({a[0] + b[0], 0, 0});
	while(true){
		auto[x, i, j] = pq.top();
		pq.pop();
		res.push_back(x);
		if(vis.find({i + 1, j}) == vis.end()) pq.push({a[i + 1] + b[j], i + 1, j});
		if(vis.find({i, j + 1}) == vis.end()) pq.push({a[i] + b[j + 1], i, j + 1});
		vis[{i + 1, j}] = 1;
		vis[{i, j + 1}] = 1;
		if(res.size() == N) break;
	}
	return {res};
}


int main(){
	vector<int> res;
	res = smallest_sums(7, {0, 2, 2, 4, 5, 6, 7}, {3, 5, 6, 7, 8, 9, 100});
	for(int i = 0; i < res.size(); i++) cout << res[i] << " ";
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccVZsIz7.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccUupef2.o:aplusb.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status