Submission #535398

# Submission time Handle Problem Language Result Execution time Memory
535398 2022-03-10T08:26:12 Z pokmui9909 Distributing Candies (IOI21_candies) C++17
0 / 100
5000 ms 12256 KB
#include "candies.h"
#include <bits/stdc++.h>
#include <vector>
using namespace std;
using ll = long long;

ll N, Q;
vector<int> a;

std::vector<int> distribute_candies(std::vector<int> c, std::vector<int> l,
                                    std::vector<int> r, std::vector<int> v) {

    N = c.size(), Q = l.size();
    a = c;
    for(int i = 0; i < Q; i++){
        for(int j = l[i]; j <= r[i]; j++){
            a[j] += v[i];
            if(a[j] > c[j]) a[j] = c[j];
            if(a[j] < 0   ) a[j] = 0;
        }
    }
    return a;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5058 ms 12256 KB Time limit exceeded
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 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -