Submission #526055

# Submission time Handle Problem Language Result Execution time Memory
526055 2022-02-13T15:58:19 Z benjaminkleyn Distributing Candies (IOI21_candies) C++17
3 / 100
5000 ms 13200 KB
#include "candies.h"
#include <vector>

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

    // subtask 1
    for (int j = 0; j < q; j++)
        for (int k = l[j]; k <= r[j]; k++)
            s[k] += v[j], s[k] = std::max(s[k], 0), s[k] = std::min(s[k], c[k]);

    return s;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 272 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 292 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 3 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 5005 ms 12112 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 288 KB Output is correct
2 Correct 204 ms 8120 KB Output is correct
3 Correct 194 ms 5892 KB Output is correct
4 Execution timed out 5025 ms 13200 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 494 ms 7640 KB Output is correct
4 Correct 509 ms 3992 KB Output is correct
5 Execution timed out 5071 ms 10784 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 272 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 292 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 3 ms 332 KB Output is correct
6 Execution timed out 5005 ms 12112 KB Time limit exceeded
7 Halted 0 ms 0 KB -