Submission #1085381

# Submission time Handle Problem Language Result Execution time Memory
1085381 2024-09-08T07:35:31 Z Timosh A Plus B (IOI23_aplusb) C++17
10 / 100
1 ms 600 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], {0, i}});
	vector<int> ans;
	for (int i = 0; i < N; i++)
	{
		auto it = st.begin();
		st.erase(it);
		ans.push_back((*it).first);
		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 0 ms 600 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 600 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 1 ms 348 KB 1st lines differ - on the 2nd token, expected: '3', found: '2'
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 600 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 1 ms 348 KB 1st lines differ - on the 2nd token, expected: '3', found: '2'
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 600 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 1 ms 348 KB 1st lines differ - on the 2nd token, expected: '3', found: '2'
6 Halted 0 ms 0 KB -