結果

問題 No.135 とりあえず1次元の問題
ユーザー kisaragi211kisaragi211
提出日時 2018-01-20 18:19:48
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 3,908 ms / 5,000 ms
コード長 340 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 20,864 KB
最終ジャッジ日時 2024-12-25 03:21:03
合計ジャッジ時間 6,654 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    X = list(map(int, input().split()))
    X.sort()
    y = []
    for i in range(N-1):
        y.append(X[i+1]-X[i])
    if y.count(0) > 0 and y.count(0) < len(y):
        for j in range(y.count(0)):
            y.pop(y.index(0))

    print(min(y))
            
    

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