Submission #436433

# Submission time Handle Problem Language Result Execution time Memory
436433 2021-06-24T13:38:23 Z PiejanVDC Distributing Candies (IOI21_candies) C++17
0 / 100
136 ms 8800 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(), q = v.size();
    vector<int64_t>dif(n+1,0);
    for(int i = 0 ; i < q ; i++) {
        if(v[i] > 0) {
            dif[l[i]]+=v[i],dif[r[i]+1]-=v[i];
        }
    }
    vector<int>ans(n);
    int curr=0;
    for(int i = 0 ; i < n ; i++) {
        curr+=dif[i];
        ans[i]=min(c[i],curr);
    }
    return ans;
}
# 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 136 ms 8800 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 1 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 -