Submission #500232

# Submission time Handle Problem Language Result Execution time Memory
500232 2021-12-30T13:32:30 Z sazid_alam Distributing Candies (IOI21_candies) C++17
0 / 100
5000 ms 8116 KB
#include "candies.h"

#include <bits/stdc++.h>
using namespace std;

vector<int> distribute_candies(vector<int> c, vector<int> l,
                                    vector<int> r, vector<int> v) {
    int n = c.size();
    vector<int> s(n, 0), sum(n + 1, 0);

    for(int i = 0; i < (int)v.size(); i++){
        for(int j = l[i]; j <= r[i]; j++){
            if(v[j] > 0) s[j] = min(c[j], s[j] + v[j]);
            else s[j] = max(0, s[j] + v[j]);
        }
    }

    return s;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5040 ms 8116 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -