제출 #1205688

#제출 시각아이디문제언어결과실행 시간메모리
1205688wpdmd76A Plus B (IOI23_aplusb)C++20
10 / 100
0 ms328 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;
	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};
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...