Submission #443353

#TimeUsernameProblemLanguageResultExecution timeMemory
443353mjhmjh1104Distributing Candies (IOI21_candies)C++17
3 / 100
5094 ms7336 KiB
#include "candies.h" #include <vector> using namespace std; vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v) { int n = (int)c.size(), q = (int)v.size(); vector<int> s(n); for (int t = 0; t < q; t++) for (int i = l[t]; i <= r[t]; i++) { s[i] += v[t]; s[i] = max(s[i], 0); s[i] = min(s[i], c[i]); } return s; }
#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...