Submission #758031

# Submission time Handle Problem Language Result Execution time Memory
758031 2023-06-14T05:12:47 Z ProtonDecay314 Fruits (NOI22_fruits) C++17
0 / 100
166 ms 15520 KB
#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 -