We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 06a3e6e commit e54461eCopy full SHA for e54461e
BAEKJOON/3Gold/수 고르기.py
@@ -0,0 +1,24 @@
1
+#
2
+# https://www.acmicpc.net/problem/2230
3
+
4
+import sys
5
+input = sys.stdin.readline
6
7
+N,M = map(int, input().split())
8
+nums = [int(input()) for _ in range(N)]
9
+nums.sort()
10
11
+end = 0
12
+ans = nums[N-1]-nums[0]
13
14
+for start in range(N):
15
+ while end < N:
16
+ diff = nums[end]-nums[start]
17
+ if diff >= M:
18
+ ans = min(ans, diff)
19
+ break
20
+ else:
21
+ end += 1
22
23
+print(ans)
24
BAEKJOON/3Gold/횡단보도.py
@@ -1,4 +1,4 @@
-#
+# 그래프 이론, 최단 경로, 데이크스트라
# https://www.acmicpc.net/problem/24042
"""
0 commit comments