답안 #161443

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
161443 2019-11-02T15:18:16 Z boolodifjenula Rasvjeta (COCI17_rasvjeta) Python 3
25 / 50
35 ms 3492 KB
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 25 ms 3300 KB Output isn't correct
2 Incorrect 27 ms 3492 KB Output isn't correct
3 Correct 29 ms 3356 KB Output is correct
4 Incorrect 30 ms 3360 KB Output isn't correct
5 Incorrect 28 ms 3320 KB Output isn't correct
6 Correct 27 ms 3348 KB Output is correct
7 Incorrect 28 ms 3348 KB Output isn't correct
8 Correct 31 ms 3300 KB Output is correct
9 Correct 35 ms 3360 KB Output is correct
10 Correct 29 ms 3356 KB Output is correct