#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll> solve_subtask_2(ll n, const vector<ll>& a, vector<ll> c) {
sort(c.begin(), c.end(), std::less<ll>());
vector<ll> ans(n, 0);
partial_sum(c.begin(), c.end(), ans.begin(), plus<ll>());
return ans;
}
void print_vec(const vector<ll>& v) {
for(const ll& vv : v) {
cout << vv << " ";
}
cout << endl;
}
int main() {
ll n;
cin >> n;
vector<ll> a(n, 0);
vector<ll> c(n, 0);
for(ll& av : a) {
cin >> av;
}
for(ll& cv : c) {
cin >> cv;
}
// Assume that subtask 2 holds
print_vec(solve_subtask_2(n, a, c));
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
166 ms |
15520 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |