Submission #435501

#TimeUsernameProblemLanguageResultExecution timeMemory
435501grtDistributing Candies (IOI21_candies)C++17
0 / 100
5016 ms10052 KiB
#include <bits/stdc++.h> #define ST first #define ND second #define PB push_back using namespace std; using ll = long long; using pi = pair<int,int>; using vi = vector<int>; int n, q; vi distribute_candies(vi c, vi l, vi r, vi v) { n = (int)c.size(); q = (int)l.size(); vi ans(n); for(int i = 0; i < q; ++i) { for(int a = l[i]; a <= r[i]; a++) { ans[a] += v[i]; ans[a] = max(ans[a], 0); ans[a] = min(ans[a], c[i]); } } 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...