Submission #145490

# Submission time Handle Problem Language Result Execution time Memory
145490 2019-08-20T08:56:51 Z charlies_moo Rasvjeta (COCI17_rasvjeta) C++
35 / 50
2 ms 376 KB
#include <iostream>
using namespace std;
int main()
{
	int n, k, l, x, i, j, s;
	cin >> n >> k >> l;
	int a[5000]={0};
	for(i=0;i<k;i++)
	{
		cin >> x;
		for(j=-l;j<=l;j++)
		{
			a[x+j]=1;
		}
	}
	s=0;
	for(i=0;i<n;i++)
	{
		if(a[i]==0)
		{
			for(j=0;j<=2*l;j++)
			{
				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 376 KB Output isn't correct
3 Incorrect 2 ms 376 KB Output isn't correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Incorrect 2 ms 376 KB Output isn't correct