Submission #839540

#TimeUsernameProblemLanguageResultExecution timeMemory
839540model_codeA Plus B (IOI23_aplusb)C++17
60 / 100
1062 ms188876 KiB
// time_limit/solution-NsqrtNlogN.cpp #include "aplusb.h" #include <vector> #include <algorithm> std::vector<int> smallest_sums(int N, std::vector<int> A, std::vector<int> B) { int h = std::min(320,N); std::vector<int> C(N*h*2-h*h); int pos = 0; for(int i=0; i<h; i++){ for(int j=0; j<N; j++) C[pos++] = A[i]+B[j]; } for(int j=0; j<h; j++){ for(int i=h; i<N; i++) C[pos++] = A[i]+B[j]; } std::sort(C.begin(),C.end()); std::vector<int> ans(N); for(int i=0; i<N; i++) ans[i] = C[i]; 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...