# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
979667 | 2024-05-11T09:40:27 Z | canadavid1 | A Plus B (IOI23_aplusb) | C++17 | 1 ms | 348 KB |
#include "aplusb.h" #include <set> #include <utility> #include <tuple> std::vector<int> smallest_sums(int N, std::vector<int> A, std::vector<int> B) { auto cmp = [&](auto a,auto b){return std::make_tuple(A[a.first]+B[a.second],a,b)<std::make_tuple(A[b.first]+B[b.second],a,b);}; 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<A.size()) q.emplace(a+1,b); if(b+1<B.size()) q.emplace(a,b+1); } return out; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 344 KB | Output is correct |
6 | Correct | 1 ms | 344 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Incorrect | 0 ms | 348 KB | 1st lines differ - on the 17th token, expected: '74', found: '140' |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 344 KB | Output is correct |
6 | Correct | 1 ms | 344 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Incorrect | 0 ms | 348 KB | 1st lines differ - on the 17th token, expected: '74', found: '140' |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 344 KB | Output is correct |
6 | Correct | 1 ms | 344 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Incorrect | 0 ms | 348 KB | 1st lines differ - on the 17th token, expected: '74', found: '140' |
9 | Halted | 0 ms | 0 KB | - |