Submission #1020936

# Submission time Handle Problem Language Result Execution time Memory
1020936 2024-07-12T11:46:48 Z NeroZein Distributing Candies (IOI21_candies) C++17
0 / 100
5000 ms 12116 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 = (int) c.size(), q = (int) l.size();
  vector<int> s(n);
  for (int i = 0; i < q; ++i) {
    for (int j = l[i]; j <= r[i]; ++j) {
      s[j] = s[j] + v[i];
      s[j] = max(s[j], 0);
      s[j] = min(s[j], c[j]); 
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      if (c[i] <= c[j]) assert(s[i] <= s[j]); 
    }
  }
  return s;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Runtime error 1 ms 604 KB Execution killed with signal 6
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5060 ms 12116 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 322 ms 7732 KB Output is correct
4 Execution timed out 5047 ms 3932 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Runtime error 1 ms 604 KB Execution killed with signal 6
3 Halted 0 ms 0 KB -