Submission #480615

#TimeUsernameProblemLanguageResultExecution timeMemory
480615HaidaraDistributing Candies (IOI21_candies)C++17
0 / 100
5022 ms7256 KiB
#include<bits/stdc++.h> #include<candies.h> using namespace std; vector<int> distribute_candies(vector<int> c,vector<int> l,vector<int> r, vector<int> v) { int n=l.size(); vector<int> res(c.size(),0); for(int i=0;i<n;i++) { for(int j=l[i];j<=r[i];j++) { if(v[i]>0) res[j]=min(res[j]+v[i],c[j]); else res[j]=max(0,res[j]-v[i]); } } return res; }
#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...