본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 23397번 Kathmandu

by 현장 2024. 7. 31.

-Code

t, d, m = map(int, input().split())
now, res = 0, "N"

for _ in range(m):
    y = int(input())

    if y - now >= t:
        res = "Y"
        break
    now = y
if d - now >= t:
    res = "Y"

print(res)