Submission #1073581

#TimeUsernameProblemLanguageResultExecution timeMemory
1073581WansurDistributing Candies (IOI21_candies)C++17
3 / 100
5074 ms13304 KiB
#include <bits/stdc++.h> #include "candies.h" using namespace std; const int maxn = 2e5 + 12; int a[maxn]; int n, m; vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v){ n = c.size(), m = l.size(); for(int i=0;i<m;i++){ for(int j=l[i];j<=r[i];j++){ a[j] += v[i]; if(a[j] < 0) a[j] = 0; if(a[j] > c[j]) a[j] = c[j]; } } return vector<int> (a, a+n); }
#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...