Submission #1062729

#TimeUsernameProblemLanguageResultExecution timeMemory
1062729fv3Distributing Candies (IOI21_candies)C++17
3 / 100
5061 ms13396 KiB
#include "candies.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v) { int N = c.size(); int Q = l.size(); vector<int> res(N); for (int q = 0; q < Q; q++) { for (int i = l[q]; i <= r[q]; i++) { if (v[q] > 0) res[i] = min(c[i], res[i] + v[q]); else res[i] = max(0, res[i] + v[q]); } } return res; }
#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...