Submission #961211

#TimeUsernameProblemLanguageResultExecution timeMemory
961211The_Cryptic_TGA Plus B (IOI23_aplusb)C++17
100 / 100
209 ms9152 KiB
#include <bits/stdc++.h> using namespace std; vector<int> smallest_sums(int n, vector<int> a, vector<int> b) { multiset<int> s; for (int i =0 ; i<n ; i++) { s.insert(a[0]+b[i]); } int i{1},j{0}; while (a[i] + b[0] < *(--s.end()) && i<n) { while (a[i] + b[j] < *(--s.end())) { s.erase(--s.end()); s.insert(a[i]+b[j]); j++; } j=0; i++; } auto it = s.begin(); int k = n; vector <int> ans; while (k--) { ans.push_back(*it); it++; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...