답안 #927425

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
927425 2024-02-14T20:45:23 Z Nonoze A Plus B (IOI23_aplusb) C++17
0 / 100
1 ms 344 KB
#include "aplusb.h"
#include <bits/stdc++.h>
using namespace std;
 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef long long ll;
 
 
// #define int long long
#define sz(x) (int)(x.size())
#define debug(x) cerr << (#x) << ": " << (x) << endl
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
 
vector<int> smallest_sums(int N, vector<int> A, vector<int> B) {
	int n=N;
	auto a=A, b=B;
    priority_queue<tuple<int, int, int>, vector<tuple<int, int, int>>, greater<>> pq;
	for (int i=0; i<n-1; i++) pq.push({a[i] + b[0], i, 0});
	vector<int> ans;
	while (sz(ans)<n) {
		int val, x, y;
		tie(val, x, y)=pq.top(); pq.pop();
		ans.push_back(val);
		if (y+1<n) pq.push({a[x]+b[y+1], x, y+1});
	}
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 344 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 344 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 344 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 344 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -