Submission #839522

#TimeUsernameProblemLanguageResultExecution timeMemory
839522model_codeA Plus B (IOI23_aplusb)C++17
100 / 100
67 ms7332 KiB
// model_solution/solution.cpp #include "aplusb.h" #include <vector> #include <set> std::vector<int> smallest_sums(int N, std::vector<int> A, std::vector<int> B) { std::set<std::pair<int,int>> szet; szet.clear(); std::vector<int> pos(N); for(int i=0; i<N; i++){ pos[i] = 0; szet.insert({A[i]+B[0],i}); } std::vector<int> ans(N); for(int i=0; i<N; i++){ auto it = szet.begin(); ans[i] = (*it).first; int id = (*it).second; szet.erase(szet.begin()); if(++pos[id] < N) szet.insert({A[id] + B[pos[id]], id}); } 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...