Submission #443353

# Submission time Handle Problem Language Result Execution time Memory
443353 2021-07-10T11:45:58 Z mjhmjh1104 Distributing Candies (IOI21_candies) C++17
3 / 100
5000 ms 7336 KB
#include "candies.h"
#include <vector>
using namespace std;

vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v) {
    int n = (int)c.size(), q = (int)v.size();
    vector<int> s(n);
    for (int t = 0; t < q; t++) for (int i = l[t]; i <= r[t]; i++) {
        s[i] += v[t];
        s[i] = max(s[i], 0);
        s[i] = min(s[i], c[i]);
    }
    return s;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 3 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 5066 ms 7336 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 265 ms 5072 KB Output is correct
3 Correct 273 ms 3804 KB Output is correct
4 Execution timed out 5094 ms 7260 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 587 ms 5056 KB Output is correct
4 Correct 598 ms 2772 KB Output is correct
5 Execution timed out 5093 ms 7236 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 3 ms 332 KB Output is correct
6 Execution timed out 5066 ms 7336 KB Time limit exceeded
7 Halted 0 ms 0 KB -