Submission #970231

# Submission time Handle Problem Language Result Execution time Memory
970231 2024-04-26T08:45:39 Z mychecksedad Distributing Candies (IOI21_candies) C++17
3 / 100
5000 ms 13396 KB
#include "candies.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(x) x.begin, x.end()
#define en cout << '\n';
#define ll long long int
const int N = 2e5+10;

vector<int> distribute_candies(std::vector<int> c, std::vector<int> l, std::vector<int> r, std::vector<int> v) {
  int n = c.size(), q = l.size();
  vector<int> s(n);
  for(int j = 0; j < q; ++j){
    for(int L = l[j]; L <= r[j]; ++L){
      s[L] = min(c[L], max(s[L] + v[j], 0));
    }
  }


  return s;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 5 ms 500 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 5063 ms 12460 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 171 ms 8028 KB Output is correct
3 Correct 162 ms 6020 KB Output is correct
4 Execution timed out 5032 ms 13396 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 512 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1295 ms 7892 KB Output is correct
4 Correct 1749 ms 4184 KB Output is correct
5 Execution timed out 5036 ms 10832 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 5 ms 500 KB Output is correct
6 Execution timed out 5063 ms 12460 KB Time limit exceeded
7 Halted 0 ms 0 KB -