# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
979328 | 2024-05-10T15:59:44 Z | Isam | Distributing Candies (IOI21_candies) | C++17 | 5000 ms | 7252 KB |
#include "candies.h" #include<bits/stdc++.h> using namespace std; constexpr int sz = 2e5 + 5; int n, Q; vector<int> a; std::vector<int> distribute_candies(std::vector<int> c, std::vector<int> l, std::vector<int> r, std::vector<int> v){ n = (int)c.size(), Q = (int)r.size(); a.assign(n, 0); for(register int q = 0; q < Q; ++q){ for(register int i = l[q]; i <= r[q]; ++i){ if(v[q] > 0){ a[i-1] = min(c[i-1], a[i-1] + v[q]); }else{ a[i-1] = max(0, a[i-1] + v[q]); } } } return a; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 5059 ms | 7252 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 600 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |