Submission #970231

#TimeUsernameProblemLanguageResultExecution timeMemory
970231mychecksedadDistributing Candies (IOI21_candies)C++17
3 / 100
5063 ms13396 KiB
#include "candies.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define all(x) x.begin, x.end() #define en cout << '\n'; #define ll long long int const int N = 2e5+10; vector<int> distribute_candies(std::vector<int> c, std::vector<int> l, std::vector<int> r, std::vector<int> v) { int n = c.size(), q = l.size(); vector<int> s(n); for(int j = 0; j < q; ++j){ for(int L = l[j]; L <= r[j]; ++L){ s[L] = min(c[L], max(s[L] + v[j], 0)); } } return s; }
#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...