Submission #617418

# Submission time Handle Problem Language Result Execution time Memory
617418 2022-08-01T11:15:37 Z amunduzbaev Distributing Candies (IOI21_candies) C++17
3 / 100
5000 ms 13228 KB
#include "candies.h"

#include "bits/stdc++.h"
using namespace std;

#ifndef EVAL
#include "grader.cpp"
#endif

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> a(n);
	for(int i=0;i<q;i++){
		for(int j=l[i];j<=r[i];j++){
			a[j] += v[i];
			a[j] = max(a[j], 0);
			a[j] = min(a[j], c[j]);
		}
	}
	
	return a;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 4 ms 312 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 5019 ms 7268 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 210 ms 8032 KB Output is correct
3 Correct 197 ms 6016 KB Output is correct
4 Execution timed out 5092 ms 13228 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 507 ms 5084 KB Output is correct
4 Correct 497 ms 2728 KB Output is correct
5 Execution timed out 5084 ms 7276 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 4 ms 312 KB Output is correct
6 Execution timed out 5019 ms 7268 KB Time limit exceeded
7 Halted 0 ms 0 KB -