Skip to content

Commit f6104c6

Browse files
committed
89차 1번 문제 풀이 (참고)
1 parent d758867 commit f6104c6

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

live8/test89/문제1/박희경.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import sys
2+
3+
input = sys.stdin.readline
4+
5+
n = int(input())
6+
arr = set()
7+
for _ in range(n):
8+
arr.add(int(input()))
9+
10+
arr = sorted(arr)
11+
12+
i = 0
13+
cnt = 0
14+
for j in range(n):
15+
while arr[j] - arr[i] > 4:
16+
i += 1
17+
cnt = max(cnt, j - i + 1)
18+
19+
20+
print(5 - cnt)

0 commit comments

Comments
 (0)