# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
587940 | 2022-07-02T14:32:25 Z | Clan328 | Distributing Candies (IOI21_candies) | C++17 | 5000 ms | 13268 KB |
#include "candies.h" #include <bits/stdc++.h> using namespace std; 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(); std::vector<int> s(n); for (int i = 0; i < l.size(); i++) { for (int j = l[i]; j <= r[i]; j++) { if (v[i] > 0) { s[j] = min(c[j], s[j]+v[i]); } else s[j] = max(0, s[j]+v[i]); } } return s; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 340 KB | Output is correct |
5 | Correct | 3 ms | 340 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 5070 ms | 12120 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 224 ms | 8012 KB | Output is correct |
3 | Correct | 160 ms | 6028 KB | Output is correct |
4 | Execution timed out | 5029 ms | 13268 KB | Time limit exceeded |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 431 ms | 7656 KB | Output is correct |
4 | Correct | 389 ms | 4008 KB | Output is correct |
5 | Execution timed out | 5067 ms | 10836 KB | Time limit exceeded |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 340 KB | Output is correct |
5 | Correct | 3 ms | 340 KB | Output is correct |
6 | Execution timed out | 5070 ms | 12120 KB | Time limit exceeded |
7 | Halted | 0 ms | 0 KB | - |