# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
443346 | 2021-07-10T11:30:27 Z | leinad2 | Distributing Candies (IOI21_candies) | C++17 | 128 ms | 7348 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>A;A.resize(n); int i, j; for(i=0;i<l.size();i++) { A[l[i]]+=v[i]; if(r[i]<n-1)A[r[i]+1]-=v[i]; } for(i=1;i<n;i++)A[i]+=A[i-1]; for(i=0;i<n;i++)if(A[i]>c[i])A[i]=c[i]; return A; }
Compilation message
# | 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 | 128 ms | 7348 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 | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |