Submission #1085384

#TimeUsernameProblemLanguageResultExecution timeMemory
1085384TimoshA Plus B (IOI23_aplusb)C++17
100 / 100
60 ms10760 KiB
#include <bits/stdc++.h> #include "aplusb.h" using namespace std; std::vector<int> smallest_sums(int N, std::vector<int> A, std::vector<int> B) { set<pair<int, pair<int, int>>> st; for (int i = 0; i < N; i++) st.insert({B[i] + A[0], {1, i}}); vector<int> ans(N); for (int i = 0; i < N; i++) { auto it = st.begin(); ans[i] = ((*it).first); st.erase(it); st.insert({B[(*it).second.second] + A[(*it).second.first], {(*it).second.first + 1, (*it).second.second}}); } sort(ans.begin(), ans.end()); 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...