結果

問題 No.135 とりあえず1次元の問題
ユーザー 双六双六
提出日時 2020-07-22 15:09:28
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 481 bytes
コンパイル時間 347 ms
コンパイル使用メモリ 86,756 KB
実行使用メモリ 92,052 KB
最終ジャッジ日時 2023-09-02 13:59:05
合計ジャッジ時間 4,624 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
91,812 KB
testcase_01 AC 93 ms
71,260 KB
testcase_02 AC 93 ms
71,492 KB
testcase_03 AC 93 ms
71,528 KB
testcase_04 AC 94 ms
71,216 KB
testcase_05 AC 94 ms
71,352 KB
testcase_06 AC 94 ms
71,360 KB
testcase_07 AC 95 ms
71,476 KB
testcase_08 AC 94 ms
71,556 KB
testcase_09 AC 95 ms
71,216 KB
testcase_10 AC 94 ms
71,620 KB
testcase_11 AC 95 ms
71,556 KB
testcase_12 AC 94 ms
71,208 KB
testcase_13 AC 93 ms
71,492 KB
testcase_14 AC 93 ms
71,356 KB
testcase_15 AC 93 ms
71,360 KB
testcase_16 AC 98 ms
71,416 KB
testcase_17 AC 96 ms
71,344 KB
testcase_18 AC 94 ms
71,200 KB
testcase_19 AC 93 ms
71,144 KB
testcase_20 AC 92 ms
71,484 KB
testcase_21 AC 113 ms
91,220 KB
testcase_22 AC 131 ms
92,052 KB
evil01.txt AC 123 ms
92,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N = int(input())
	X = list(sorted(getlist()))
	if N == 1:
		print(0)

	ans = INF
	for i in range(N - 1):
		if X[i + 1] != X[i]:
			ans = min(ans, X[i + 1] - X[i])

	if ans != INF:
		print(ans)
	else:
		print(0)



if __name__ == '__main__':
	main()
0