Submission #1038284

#TimeUsernameProblemLanguageResultExecution timeMemory
1038284Marco_EscandonDistributing Candies (IOI21_candies)C++17
38 / 100
5043 ms14216 KiB
#pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include "candies.h" #include <bits/stdc++.h> using namespace std; const int MAXN = 2e5; const int T = 700; int A[MAXN]; vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v) { int q = l.size(), n = c.size(); vector<int> A(n, 0); for (int s = 0; s < MAXN; s += T) { int fl = s, fr = s + T - 1; for (int i = 0; i < q; i++) { int tl = (fl > l[i] ? fl : l[i]); int tr = (fr < r[i] ? fr : r[i]); for (int j = tl; j <= tr; j++) { A[j] = A[j] + v[i]; A[j] = (A[j] >= c[j] ? c[j] : A[j]); A[j] = (A[j] >= 0 ? A[j] : 0); } } } return A; }
#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...