結果

問題 No.135 とりあえず1次元の問題
ユーザー alcoholampalcoholamp
提出日時 2019-10-30 10:58:26
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 84 ms / 5,000 ms
コード長 335 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 10,576 KB
実行使用メモリ 24,436 KB
最終ジャッジ日時 2023-10-12 23:41:40
合計ジャッジ時間 1,760 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
24,436 KB
testcase_01 AC 16 ms
7,864 KB
testcase_02 AC 15 ms
7,808 KB
testcase_03 AC 16 ms
7,948 KB
testcase_04 AC 16 ms
7,724 KB
testcase_05 AC 15 ms
7,820 KB
testcase_06 AC 16 ms
7,724 KB
testcase_07 AC 15 ms
7,720 KB
testcase_08 AC 15 ms
7,952 KB
testcase_09 AC 16 ms
7,772 KB
testcase_10 AC 16 ms
7,968 KB
testcase_11 AC 15 ms
7,720 KB
testcase_12 AC 15 ms
7,796 KB
testcase_13 AC 15 ms
7,824 KB
testcase_14 AC 16 ms
8,188 KB
testcase_15 AC 16 ms
7,836 KB
testcase_16 AC 16 ms
8,220 KB
testcase_17 AC 15 ms
8,296 KB
testcase_18 AC 15 ms
7,788 KB
testcase_19 AC 16 ms
8,264 KB
testcase_20 AC 16 ms
7,864 KB
testcase_21 AC 45 ms
15,888 KB
testcase_22 AC 80 ms
24,288 KB
evil01.txt AC 70 ms
24,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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