Submission #813906

#TimeUsernameProblemLanguageResultExecution timeMemory
813906alvingogoDistributing Candies (IOI21_candies)C++17
3 / 100
5034 ms7284 KiB
#include "candies.h" #include <bits/stdc++.h> #define fs first #define sc second #define p_q priority_queue using namespace std; vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v) { int n = c.size(); vector<int> s(n); int q=l.size(); for(int i=0;i<q;i++){ if(v[i]<0){ for(int j=l[i];j<=r[i];j++){ s[j]=max(0,s[j]+v[i]); } } else{ for(int j=l[i];j<=r[i];j++){ 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...