Submission #1076109

#TimeUsernameProblemLanguageResultExecution timeMemory
1076109ItamarDistributing Candies (IOI21_candies)C++17
3 / 100
5095 ms13396 KiB
#include "candies.h" #include<bits/stdc++.h> #define vi vector<int> 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(); vi ans(n); int m = r.size(); for(int j = 0; j < m; j++){ for(int i = l[j]; i <= r[j]; i++){ 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...