Submission #1021451

# Submission time Handle Problem Language Result Execution time Memory
1021451 2024-07-12T18:25:01 Z Wael Distributing Candies (IOI21_candies) C++17
3 / 100
5000 ms 13392 KB
#include "candies.h"
#include <bits/stdc++.h>
//#include "grader.cpp"
using namespace std;

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

    vector<int> s(n);
    for (int j = 0; j < q; ++j) {
        for (int i = l[j]; i <= r[j]; ++i) {
            s[i] += v[j];
            s[i] = min(s[i], c[i]);
            s[i] = max(s[i], 0);
        }
    }

    return s;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 476 KB Output is correct
5 Correct 2 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 5028 ms 12120 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 131 ms 7928 KB Output is correct
3 Correct 132 ms 6020 KB Output is correct
4 Execution timed out 5017 ms 13392 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 314 ms 7644 KB Output is correct
4 Correct 325 ms 4264 KB Output is correct
5 Execution timed out 5015 ms 10832 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 476 KB Output is correct
5 Correct 2 ms 344 KB Output is correct
6 Execution timed out 5028 ms 12120 KB Time limit exceeded
7 Halted 0 ms 0 KB -