# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
979664 | 2024-05-11T09:36:20 Z | canadavid1 | A Plus B (IOI23_aplusb) | C++17 | 1 ms | 424 KB |
#include "aplusb.h" #include <set> #include <utility> std::vector<int> smallest_sums(int N, std::vector<int> A, std::vector<int> B) { auto cmp = [&](auto a,auto b){return A[a.first]+B[a.second]<A[b.first]+B[b.second];}; std::set<std::pair<int,int>,decltype(cmp)> q(cmp); std::vector<int> out; q.emplace(0,0); while(out.size()<N) { auto[a,b] = *q.begin(); out.push_back(A[a]+B[b]); q.erase(q.begin()); if(a+1<N) q.emplace(a+1,b); if(b+1<N) q.emplace(a,b+1); } return out; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 424 KB | Output is correct |
4 | Correct | 1 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 424 KB | Output is correct |
4 | Correct | 1 ms | 348 KB | Output is correct |
5 | Correct | 1 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Incorrect | 1 ms | 348 KB | 1st lines differ - on the 17th token, expected: '74', found: '140' |
9 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 424 KB | Output is correct |
4 | Correct | 1 ms | 348 KB | Output is correct |
5 | Correct | 1 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Incorrect | 1 ms | 348 KB | 1st lines differ - on the 17th token, expected: '74', found: '140' |
9 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 424 KB | Output is correct |
4 | Correct | 1 ms | 348 KB | Output is correct |
5 | Correct | 1 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Incorrect | 1 ms | 348 KB | 1st lines differ - on the 17th token, expected: '74', found: '140' |
9 | Halted | 0 ms | 0 KB | - |