Submission #1051771

#TimeUsernameProblemLanguageResultExecution timeMemory
1051771user736482A Plus B (IOI23_aplusb)C++17
100 / 100
56 ms8392 KiB
#include<bits/stdc++.h> #include<aplusb.h> using namespace std; vector<int> smallest_sums(int n,vector<int>a,vector<int>b){ vector<int>ans; set<pair<int,pair<int,int>>>s; s.insert({a[0]+b[0],{0,0}}); for(int i=0;i<n-1;i++){ pair<int,pair<int,int>>pr=*s.begin(); s.erase(s.begin()); ans.push_back(pr.first); s.insert({a[pr.second.first+1]+b[pr.second.second],{pr.second.first+1,pr.second.second}}); s.insert({a[pr.second.first]+b[pr.second.second+1],{pr.second.first,pr.second.second+1}}); } ans.push_back((*s.begin()).first); 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...