結果

問題 No.135 とりあえず1次元の問題
ユーザー nyankologynyankology
提出日時 2018-11-29 09:26:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 116 ms / 5,000 ms
コード長 328 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 21,140 KB
最終ジャッジ日時 2023-09-09 05:51:09
合計ジャッジ時間 2,141 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
21,044 KB
testcase_01 AC 16 ms
7,876 KB
testcase_02 AC 15 ms
7,936 KB
testcase_03 AC 16 ms
7,828 KB
testcase_04 AC 16 ms
7,836 KB
testcase_05 AC 16 ms
7,788 KB
testcase_06 AC 15 ms
7,868 KB
testcase_07 AC 15 ms
7,824 KB
testcase_08 AC 16 ms
7,844 KB
testcase_09 AC 16 ms
7,932 KB
testcase_10 AC 16 ms
7,820 KB
testcase_11 AC 15 ms
7,812 KB
testcase_12 AC 16 ms
7,808 KB
testcase_13 AC 16 ms
7,860 KB
testcase_14 AC 16 ms
7,788 KB
testcase_15 AC 17 ms
7,740 KB
testcase_16 AC 17 ms
8,232 KB
testcase_17 AC 16 ms
8,256 KB
testcase_18 AC 16 ms
7,820 KB
testcase_19 AC 16 ms
7,740 KB
testcase_20 AC 16 ms
7,740 KB
testcase_21 AC 81 ms
20,712 KB
testcase_22 AC 116 ms
21,140 KB
evil01.txt AC 84 ms
21,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
f = input()
s_f = f.split()
s = [int(v) for v in s_f]
s.sort()

a = []
for v in range(0, N - 1):
    a.append(s[v + 1]-s[v])

a.sort()

if not a:
    print(0)
else:
    b = max(a)
    if b == 0:
        print(b)
    else:
        for v in a:
            if v > 0:
                print(v)
                break
0