# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
436379 | 2021-06-24T13:05:25 Z | PiejanVDC | Distributing Candies (IOI21_candies) | C++17 | 139 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) { vector<int>sum(c.size()+1,0); for(int i = 0 ; i < v.size() ; i++) { sum[l[i]]+=v[i],sum[r[i]+1]-=v[i]; } vector<int>ans(c.size(),0); int current_sum=0; for(int i = 0 ; i < c.size() ; i++) { current_sum+=sum[i]; ans[i] = min(c[i],current_sum); } return ans; }
Compilation message
# | 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 | 139 ms | 8116 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 | - |