結果

問題 No.135 とりあえず1次元の問題
ユーザー MamonboMamonbo
提出日時 2015-07-05 01:46:10
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 130 ms / 5,000 ms
コード長 427 bytes
コンパイル時間 470 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 26,648 KB
最終ジャッジ日時 2023-09-01 03:52:59
合計ジャッジ時間 2,493 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
26,500 KB
testcase_01 AC 16 ms
7,864 KB
testcase_02 AC 15 ms
7,820 KB
testcase_03 AC 15 ms
7,940 KB
testcase_04 AC 16 ms
7,896 KB
testcase_05 AC 15 ms
7,956 KB
testcase_06 AC 16 ms
7,784 KB
testcase_07 AC 16 ms
7,900 KB
testcase_08 AC 16 ms
7,916 KB
testcase_09 AC 15 ms
7,844 KB
testcase_10 AC 15 ms
7,820 KB
testcase_11 AC 16 ms
7,900 KB
testcase_12 AC 15 ms
7,824 KB
testcase_13 AC 16 ms
7,784 KB
testcase_14 AC 16 ms
8,328 KB
testcase_15 AC 16 ms
7,900 KB
testcase_16 AC 17 ms
8,444 KB
testcase_17 AC 17 ms
8,300 KB
testcase_18 AC 15 ms
7,788 KB
testcase_19 AC 17 ms
8,348 KB
testcase_20 AC 16 ms
7,820 KB
testcase_21 AC 71 ms
19,936 KB
testcase_22 AC 121 ms
26,648 KB
evil01.txt AC 108 ms
26,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding=UTF-8

N=int(input())

mojir=input()
#総当たりしたらO(N^2)
#隣り合うのにしたらO(N)

hyo=mojir.split(" ")
hyoon=list(range(0,N,1))
for idx in range(0,N,1):
    hyoon[idx]=int(hyo[idx])
#remove dup
hyon=list(set(hyoon))
myon=sorted(hyon)

#対称
dist=[]
for idx in range(0,len(myon)-1,1):
    dist.append(myon[idx+1]-myon[idx])

#print(dist)
if len(dist) != 0:
    print(min(dist))    
else:
    print(0)
0