Submission #549451

# Submission time Handle Problem Language Result Execution time Memory
549451 2022-04-15T20:18:07 Z kilikuma Distributing Candies (IOI21_candies) C++17
0 / 100
5000 ms 12480 KB
#include <bits/stdc++.h>
#include "candies.h"

using namespace std;
vector<int>distribute_candies(vector<int>c,vector<int>l,vector<int>r,vector<int>v) {
  int N = c.size();
  int Q = l.size();
  vector<int> S;
  for (int i = 0; i < N + 1; i ++)
    S.push_back(0);
  for (int i = 0; i < Q; 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;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5078 ms 12480 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -