# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
819908 | 2023-08-10T15:21:38 Z | Marco_Escandon | Distributing Candies (IOI21_candies) | C++17 | 5000 ms | 14032 KB |
#include<bits/stdc++.h> typedef long long ll; using namespace std; std::vector<int> distribute_candies(std::vector<int> cad, std::vector<int> l, std::vector<int> r, std::vector<int> v) { ll t[cad.size()+5]={}; ll n=cad.size(); for(int i=0; i<l.size(); i++) { for(int j=l[i]; j<=r[i]; j++) { t[j]+=v[i]; t[j]=max(0LL,t[j]); t[j]=min((ll)cad[j],t[j]); } } cad[0]=min(t[0],(ll)cad[0]); for(int i=1; i<n; i++) { cad[i]=min(t[i],(ll)cad[i]); } return cad; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 340 KB | Output is correct |
5 | Correct | 2 ms | 316 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 5086 ms | 12960 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 167 ms | 8012 KB | Output is correct |
3 | Correct | 164 ms | 7576 KB | Output is correct |
4 | Execution timed out | 5068 ms | 14032 KB | Time limit exceeded |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 300 KB | Output is correct |
3 | Correct | 411 ms | 7660 KB | Output is correct |
4 | Correct | 431 ms | 5568 KB | Output is correct |
5 | Execution timed out | 5064 ms | 11552 KB | Time limit exceeded |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 340 KB | Output is correct |
5 | Correct | 2 ms | 316 KB | Output is correct |
6 | Execution timed out | 5086 ms | 12960 KB | Time limit exceeded |
7 | Halted | 0 ms | 0 KB | - |