Submission #549452

# Submission time Handle Problem Language Result Execution time Memory
549452 2022-04-15T20:19:03 Z kilikuma Distributing Candies (IOI21_candies) C++17
0 / 100
5000 ms 7656 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 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5063 ms 7656 KB Time limit exceeded
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 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -