Submission #1042722

#TimeUsernameProblemLanguageResultExecution timeMemory
1042722Dan4LifeDistributing Candies (IOI21_candies)C++17
38 / 100
5050 ms14200 KiB
#pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #include "candies.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define sz(a) (int)a.size() #define all(a) begin(a),end(a) using vi = vector<int>; using ll = long long; vi distribute_candies(vi c, vi l, vi r, vi v){ int n = sz(c), q = sz(l); vector<int> ans(n,0); for(int i = 0; i < q; i++){ for(int j = l[i]; j <= r[i]; j++){ ans[j]+=v[i]; ans[j]=min(ans[j],c[j]); ans[j]=max(ans[j],0); } } 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...