Submission #472685

# Submission time Handle Problem Language Result Execution time Memory
472685 2021-09-14T07:51:30 Z oliversommer Distributing Candies (IOI21_candies) C++17
0 / 100
154 ms 7336 KB
#include "candies.h"

#include <algorithm>
#include <vector>

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(n);

	for (int j = 0; j < q; ++j) {
		s[l[j]] = min(s[l[j]] + v[j], c[j]);
		s[r[j]] = s[r[j]] - s[l[j]];
	}

	for(int i = 1; i < n; ++i) {
		s[i] += s[i - 1];
	}

	return s;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 154 ms 7336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -