Submission #838760

# Submission time Handle Problem Language Result Execution time Memory
838760 2023-08-27T17:22:26 Z ErJ Distributing Candies (IOI21_candies) C++17
0 / 100
88 ms 8176 KB
#include <vector>
#include <cmath>
#include <algorithm>
#include <iostream>

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> ans(n);
    vector<int> change(n + 1);
    for (int i = 0; i < q; i++) {
        change[l[i]] += v[i];
        change[r[i] +1] -= v[i];
    }
    int akt = 0;
    for (int i = 0; i < n; i++) {
        akt += change[i];
        ans[i] = min(c[i], akt);
    }
    return ans;
}
# 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 88 ms 8176 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 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -