[백준/Python] 1449번. 수리공 항승
·
코딩테스트/BAEKJOON
📌 문제유형: 탐욕법(그리디) 📌 문제링크 https://www.acmicpc.net/problem/1449 📌 풀이코드 N, L = map(int, input().split())holes = list(map(int, input().split()))covered = [0 for _ in range(len(holes))]holes.sort()count = 0for i, h in enumerate(holes): able = [(h-0.5), (h-0.5) + L] # 커버 가능한 범위 if not covered[i]: covered[i] = 1 count += 1 for j in range(i+1, len(holes)): if able..