Submission #545865

#TimeUsernameProblemLanguageResultExecution timeMemory
545865fuad27Distributing Candies (IOI21_candies)C++17
0 / 100
5044 ms8012 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 = c.size(); vector<int> s(n, 0); for(int i = 0;i<n;i++) { for(int j = 0;j<n;j++) { if(j >= l[i] and j <= r[i]) { if(v[i] > 0) { s[j] = min(c[j], s[j] + v[i]); } else { s[j] = max(0, 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...