Submission #438956

#TimeUsernameProblemLanguageResultExecution timeMemory
438956jlozano254Distributing Candies (IOI21_candies)C++17
0 / 100
5056 ms12096 KiB
#include "candies.h" #include <vector> using namespace std; std::vector<int> distribute_candies(std::vector<int> c, std::vector<int> l, std::vector<int> r, std::vector<int> v) { int n = c.size(); std::vector<int> s(n); for (int i = 0; i <= n; ++i) { for (int j = l[i]; j <= r[i]; ++j) { if (v[i] < 0) { s[j] = max(0, s[j] + v[i]); } else { s[j] = min(c[j], s[j] + v[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...