Submission #599928

#TimeUsernameProblemLanguageResultExecution timeMemory
599928Valaki2Distributing Candies (IOI21_candies)C++17
3 / 100
5066 ms13220 KiB
#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(); int q = v.size(); vector<int> ans(n, 0); for(int i = 0; i < n; i++) { for(int j = 0; j < q; j++) { if(l[j] <= i && i <= r[j]) { ans[i] = max(0, min(c[i], ans[i] + v[j])); } } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...