Submission #841913

#TimeUsernameProblemLanguageResultExecution timeMemory
841913nononoA Plus B (IOI23_aplusb)C++17
100 / 100
49 ms4056 KiB
#include "aplusb.h" #include <bits/stdc++.h> using namespace std; vector<int> smallest_sums(int N, vector<int> A, vector<int> B) { vector<int> C(N, 0); priority_queue<array<int, 3>, vector<array<int, 3>>, greater<array<int, 3>>> pq; for(int i = 0; i < N; i ++) pq.push({A[i] + B[0], i, 0}); int M = 0; while(!pq.empty() && M < N) { int x = pq.top()[0]; int i = pq.top()[1]; int j = pq.top()[2]; pq.pop(); C[M ++] = x; if(j + 1 < N) { pq.push({A[i] + B[j + 1], i, j + 1}); } } return C; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...