Submission #440230

# Submission time Handle Problem Language Result Execution time Memory
440230 2021-07-01T19:17:03 Z BaraaArmoush Distributing Candies (IOI21_candies) C++17
0 / 100
126 ms 8800 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v) {
    int n = c.size();
    int q = l.size();

    vector<int> a(n);
    vector<ll> p(n + 1);

    for (int j = 0; j < q; j++) {
        p[l[j]] += v[j];
        p[r[j]] -= v[j];
    }

    for (int i = 1; i <= n; i++) {
        p[i] += p[i - 1];
    }

    for (int i = 0; i < n; i++) {
        a[i] = min((ll)c[i], p[i]);
    }

    return a;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 126 ms 8800 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -