# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
826563 | 2023-08-15T16:57:03 Z | Seb | Distributing Candies (IOI21_candies) | C++17 | 96 ms | 8032 KB |
#include "candies.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; 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(),sum=0; vector <int> ans(n),acom(n+1); for (int i=0;i<=n;i++) acom[i] = 0; for (int j=0;j<l.size();j++) { acom[l[j]] += v[j]; acom[r[j]+1] -= v[j]; } for (int i=1;i<=n;i++) acom[i] += acom[i-1]; for (int i=0;i<n;i++) ans[i] = min(acom[i],c[i]); return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 96 ms | 8032 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |