Submission #543987

#TimeUsernameProblemLanguageResultExecution timeMemory
543987brunnorezendesDistributing Candies (IOI21_candies)C++17
3 / 100
5089 ms13264 KiB
#include "candies.h" #include <bits/stdc++.h> using namespace std; typedef vector<int> vi; vi distribute_candies(vi c, vi l, vi r, vi v){ int i, j; int q = l.size(); int n = c.size(); vi val(n, 0); for(i=0;i<n;i++){ for(j=0;j<q;j++){ if(i>=l[j] && i<=r[j]){ if(v[j]<0) val[i] = max(0, val[i]+v[j]); else val[i] = min(c[i], val[i]+v[j]); } } } return val; }
#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...