結果

問題 No.135 とりあえず1次元の問題
ユーザー soupesuteakasoupesuteaka
提出日時 2016-03-03 17:23:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 137 ms / 5,000 ms
コード長 349 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,628 KB
実行使用メモリ 20,740 KB
最終ジャッジ日時 2023-09-02 00:18:05
合計ジャッジ時間 2,802 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
20,232 KB
testcase_01 AC 25 ms
9,188 KB
testcase_02 AC 24 ms
9,236 KB
testcase_03 AC 24 ms
9,316 KB
testcase_04 AC 24 ms
9,356 KB
testcase_05 AC 24 ms
9,268 KB
testcase_06 AC 24 ms
9,360 KB
testcase_07 AC 25 ms
9,188 KB
testcase_08 AC 25 ms
9,248 KB
testcase_09 AC 24 ms
9,176 KB
testcase_10 AC 24 ms
9,180 KB
testcase_11 AC 24 ms
9,192 KB
testcase_12 AC 25 ms
9,272 KB
testcase_13 AC 24 ms
9,192 KB
testcase_14 AC 24 ms
9,320 KB
testcase_15 AC 24 ms
9,272 KB
testcase_16 AC 25 ms
9,284 KB
testcase_17 AC 25 ms
9,424 KB
testcase_18 AC 24 ms
9,364 KB
testcase_19 AC 25 ms
9,312 KB
testcase_20 AC 25 ms
9,308 KB
testcase_21 AC 79 ms
20,740 KB
testcase_22 AC 129 ms
20,204 KB
evil01.txt AC 114 ms
20,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding: UTF-8

import sys
import re
import itertools
from math import log
from collections import deque

### defs ###


### main ###
N = int(sys.stdin.readline())
X = list(map(int,sys.stdin.readline().split()))
X.sort()
ans=10000000
for i in range(1,N):
	x = X[i]-X[i-1]
	if(x==0):
		continue
	ans = min(ans,x)
if(ans==10000000):
	ans=0

print(ans)
0