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=-K
p=-K
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 |
26 ms |
3300 KB |
Output isn't correct |
2 |
Incorrect |
25 ms |
3360 KB |
Output isn't correct |
3 |
Incorrect |
27 ms |
3360 KB |
Output isn't correct |
4 |
Incorrect |
28 ms |
3356 KB |
Output isn't correct |
5 |
Incorrect |
28 ms |
3360 KB |
Output isn't correct |
6 |
Incorrect |
27 ms |
3348 KB |
Output isn't correct |
7 |
Incorrect |
28 ms |
3360 KB |
Output isn't correct |
8 |
Incorrect |
32 ms |
3480 KB |
Output isn't correct |
9 |
Incorrect |
35 ms |
3356 KB |
Output isn't correct |
10 |
Correct |
28 ms |
3356 KB |
Output is correct |