結果

問題 No.135 とりあえず1次元の問題
コンテスト
ユーザー alcoholamp
提出日時 2019-10-30 10:58:26
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WJ  
(最新)
AC  
(最初)
実行時間 -
コード長 335 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
最終ジャッジ日時 2026-08-27 11:42:35
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)

ソースコード

diff #
raw source code

class Problem0135:
	def solve(this):
		n = int(input())
		x = set(map(int,input().split()))
		x = sorted(list(x))
		
		if len(x) == 1:
			print(0)
			return 
		
		res = []
		for i in range(len(x) - 1):
			d = abs(x[i+1] - x[i])
			res.append(d)
		print(min(res))
		
if __name__ == "__main__":
	problem = Problem0135()
	problem.solve()
0