Submission #145495

# Submission time Handle Problem Language Result Execution time Memory
145495 2019-08-20T09:04:27 Z charlies_moo Rasvjeta (COCI17_rasvjeta) C++
35 / 50
3 ms 504 KB
#include <iostream>
using namespace std;
int main()
{
	int n, k, l, x, i, j, s;
	cin >> n >> k >> l;
	int a[n]={0};
	for(i=0;i<k;i++)
	{
		cin >> x;
		for(j=-l;j<=l;j++)
		{
			if(x+j>=0)
			    a[x+j]=1;
		}
	}
	s=0;
	for(i=0;i<n;i++)
	{
		if(a[i]==0)
		{
			for(j=0;j<=2*l;j++)
			{
				if(i+j<n)
				    a[i+j]=1;
			}
			s++;
		}
	}
	cout << s;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 256 KB Output isn't correct
3 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Incorrect 2 ms 256 KB Output isn't correct