# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
894874 | 2023-12-29T06:54:09 Z | Sir_Ahmed_Imran | Distributing Candies (IOI21_candies) | C++17 | 5000 ms | 10600 KB |
///~~~LOTA~~~/// #include "candies.h" #include <bits/stdc++.h> using namespace std; #define nl '\n' #define ff first #define ss second #define ll long long #define append push_back #define pii pair<int,int> #define all(x) (x).begin(),(x).end() #define N 300001 vector<int> distribute_candies(vector<int> c,vector<int> l,vector<int> r,vector<int> v){ int o,p,q; vector<int> x,y; for(int i=o=0;i<c.size();i++) y.append(0); for(int i=0;i<l.size();i++){ p=v[i]; for(int j=l[i];j<=r[i];j++){ q=c[j]; if(v[i]>0) o+=min(p,q-y[j]); else o+=max(p,-y[j]); y[j]=max(0,min(q,y[j]+p)); } x.append(o); } return x; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 5071 ms | 10600 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |