Submission #442948

# Submission time Handle Problem Language Result Execution time Memory
442948 2021-07-09T11:42:56 Z benedict0724 Distributing Candies (IOI21_candies) C++17
0 / 100
128 ms 7336 KB
#include "candies.h"

#include <vector>
using namespace std;

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();
    int q = l.size();
    std::vector<int> s(n);
    for(int i=0;i<q;i++)
    {
        s[l[i]] += v[i];
        if(r[i] < n-1) s[r[i]+1] -= v[i];
    }
    for(int i=1;i<n;i++) s[i] += s[i-1];
    return s;
}
# 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 128 ms 7336 KB Output isn't correct
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 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -