Submission #1058900

#TimeUsernameProblemLanguageResultExecution timeMemory
1058900LittleOrangeDistributing Candies (IOI21_candies)C++17
3 / 100
5090 ms13376 KiB
#include "candies.h" #include <vector> #include<bits/stdc++.h> using namespace std; using ll = int; std::vector<int> distribute_candies(std::vector<int> c, std::vector<int> l, std::vector<int> r, std::vector<int> v) { int n = c.size(); ll q = l.size(); vector<ll> out(n); for(ll i = 0;i<q;i++){ for(ll j = l[i];j<=r[i];j++){ out[j] += v[i]; out[j] = max(min(out[j],c[j]),0); } } return out; }
#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...