# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1085383 |
2024-09-08T07:39:06 Z |
Timosh |
A Plus B (IOI23_aplusb) |
C++17 |
|
1 ms |
348 KB |
#include <bits/stdc++.h>
#include "aplusb.h"
using namespace std;
std::vector<int> smallest_sums(int N, std::vector<int> A, std::vector<int> B)
{
set<pair<int, pair<int, int>>> st;
for (int i = 0; i < N; i++)
st.insert({B[i] + A[0], {1, i}});
vector<int> ans(N);
for (int i = 0; i < N; i++)
{
auto it = st.begin();
ans[i] = ((*it).first);
st.erase(it);
st.insert({(*it).first + B[(*it).second.second] + A[(*it).second.first], {(*it).second.first + 1, (*it).second.second}});
}
sort(ans.begin(), ans.end());
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Incorrect |
1 ms |
344 KB |
1st lines differ - on the 2nd token, expected: '3', found: '4' |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Incorrect |
1 ms |
344 KB |
1st lines differ - on the 2nd token, expected: '3', found: '4' |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Incorrect |
1 ms |
344 KB |
1st lines differ - on the 2nd token, expected: '3', found: '4' |
6 |
Halted |
0 ms |
0 KB |
- |