# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
681370 | 2023-01-12T21:16:56 Z | Gabriel | Distributing Candies (IOI21_candies) | C++17 | 5000 ms | 13288 KB |
#include "candies.h" #include <bits/stdc++.h> using namespace std; vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v){ int n = c.size(); vector<int> s(n, 0); int aa = 0; while(aa != v.size()){ int bb = l[aa]; while(bb <= r[aa]){ if(v[aa] > 0) s[bb] = min(c[bb], s[bb] + v[aa]); else s[bb] = max(0, s[bb] + v[aa]); bb++; } aa++; } return s; }
Compilation message
# | 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 | 1 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 312 KB | Output is correct |
5 | Correct | 3 ms | 340 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 5015 ms | 12124 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 | 177 ms | 7980 KB | Output is correct |
3 | Correct | 154 ms | 5916 KB | Output is correct |
4 | Execution timed out | 5030 ms | 13288 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 | 424 ms | 7660 KB | Output is correct |
4 | Correct | 385 ms | 4012 KB | Output is correct |
5 | Execution timed out | 5057 ms | 10788 KB | Time limit exceeded |
6 | 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 | 1 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 312 KB | Output is correct |
5 | Correct | 3 ms | 340 KB | Output is correct |
6 | Execution timed out | 5015 ms | 12124 KB | Time limit exceeded |
7 | Halted | 0 ms | 0 KB | - |