N=int(input())
M=int(input())
K=int(input())
O=[i+1 for i in range (N)]
for i in range(M):
P=int(input())
for i in range(P-K-1,P+K):
if -1<i<len(O):
O[i]=0
k=0
p=0
s=0
for i in range(N):
if O[i]:
k+=1
elif k:
p+=1
if k and k+p==K+1:
s+=1
k=-K
p=-K
if i==N-1 and s==0 and k:
s+=1
print(s)
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
27 ms |
3360 KB |
Output isn't correct |
2 |
Incorrect |
26 ms |
3300 KB |
Output isn't correct |
3 |
Correct |
29 ms |
3360 KB |
Output is correct |
4 |
Incorrect |
29 ms |
3360 KB |
Output isn't correct |
5 |
Incorrect |
27 ms |
3352 KB |
Output isn't correct |
6 |
Correct |
27 ms |
3356 KB |
Output is correct |
7 |
Incorrect |
30 ms |
3312 KB |
Output isn't correct |
8 |
Correct |
31 ms |
3320 KB |
Output is correct |
9 |
Correct |
36 ms |
3336 KB |
Output is correct |
10 |
Correct |
30 ms |
3400 KB |
Output is correct |