제출 #239307

#제출 시각아이디문제언어결과실행 시간메모리
239307MrRobot_28Rasvjeta (COCI17_rasvjeta)C++17
50 / 50
5 ms384 KiB
#include <bits/stdc++.h>
using namespace std;

signed main()
{
	int n, m, k;
	cin >> n >> m >> k;
	int last = 1;
	int cnt = 0;
	for(int i = 0; i < m; i++)
	{
		int a;
		cin >> a;
		while(last < a - k)
		{
			last += 2 * k + 1;
			cnt++;
		}
		last = a + k + 1;
	}
	while(last <= n)
	{
		last += 2 * k + 1;
		cnt++;
	}
	cout << cnt;
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...