Submission #1048918

#TimeUsernameProblemLanguageResultExecution timeMemory
1048918nisanduuDistributing Candies (IOI21_candies)C++17
0 / 100
5035 ms7412 KiB
#include "candies.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v) { int n = c.size(); vector<int> s(n); for(ll i=0;i<n;i++){ for(ll j=l[i];j<=r[i];j++){ if(v[i]>0){ s[j] = max(s[j]+v[i],c[i]); }else{ s[j] = min(s[j]-v[i],0); } } } 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...