Submission #768383

#TimeUsernameProblemLanguageResultExecution timeMemory
768383PurpleCrayonDistributing Candies (IOI21_candies)C++17
3 / 100
5078 ms13280 KiB
#include "candies.h" #include <bits/stdc++.h> using namespace std; #define sz(v) int(v.size()) #define ar array typedef long long ll; const int N = 2e5+10, MOD = 1e9+7; vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v) { int n = sz(c), q = sz(v); vector<int> ans(n); for (int i = 0; i < q; i++) { for (int j = l[i]; j <= r[i]; j++) { ans[j] += v[i]; ans[j] = max(ans[j], 0); ans[j] = min(ans[j], c[j]); } } return ans; }
#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...