Submission #986991

# Submission time Handle Problem Language Result Execution time Memory
986991 2024-05-21T16:49:10 Z pedroslrey Distributing Candies (IOI21_candies) C++17
3 / 100
5000 ms 13396 KB
#include <bits/stdc++.h>
#include "candies.h"

using namespace std;
using lli = long long;

vector<int> distribute_candies(vector<int> cs, vector<int> ls, vector<int> rs, vector<int> xs) {
	int n = cs.size(), q = ls.size();

	vector<int> vals(n);
	for (int qq = 0; qq < q; ++qq)
		for (int i = ls[qq]; i <= rs[qq]; ++i) 
			vals[i] = max(0, min(cs[i], vals[i] + xs[qq]));

	return vals;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 448 KB Output is correct
5 Correct 3 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 5016 ms 12112 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 170 ms 8160 KB Output is correct
3 Correct 192 ms 6016 KB Output is correct
4 Execution timed out 5040 ms 13396 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 Correct 1 ms 348 KB Output is correct
3 Correct 427 ms 7780 KB Output is correct
4 Correct 416 ms 4028 KB Output is correct
5 Execution timed out 5039 ms 10848 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 448 KB Output is correct
5 Correct 3 ms 348 KB Output is correct
6 Execution timed out 5016 ms 12112 KB Time limit exceeded
7 Halted 0 ms 0 KB -