結果

問題 No.716 距離
ユーザー iad_2889iad_2889
提出日時 2019-04-27 14:57:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 402 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-05-05 21:13:25
合計ジャッジ時間 2,231 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,624 KB
testcase_01 AC 28 ms
10,752 KB
testcase_02 AC 27 ms
10,752 KB
testcase_03 AC 27 ms
10,880 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 29 ms
10,752 KB
testcase_06 AC 32 ms
10,880 KB
testcase_07 AC 27 ms
10,624 KB
testcase_08 AC 25 ms
10,496 KB
testcase_09 AC 27 ms
10,752 KB
testcase_10 AC 26 ms
10,624 KB
testcase_11 WA -
testcase_12 AC 27 ms
10,752 KB
testcase_13 AC 26 ms
10,752 KB
testcase_14 WA -
testcase_15 AC 26 ms
10,624 KB
testcase_16 WA -
testcase_17 AC 28 ms
10,752 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 28 ms
10,496 KB
testcase_25 AC 27 ms
10,752 KB
testcase_26 WA -
testcase_27 AC 27 ms
10,496 KB
testcase_28 WA -
testcase_29 AC 27 ms
10,752 KB
testcase_30 WA -
testcase_31 AC 26 ms
10,624 KB
testcase_32 AC 27 ms
10,752 KB
testcase_33 WA -
testcase_34 AC 27 ms
10,752 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 28 ms
10,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
points = list({int(x) for x in input().split()})
min_distance = -1
if len(points) < N:
    min_distance = 0
minp1 = points[0]
minp2 = points[1]
maxp = points[0]
for i in points[1:]:
    if i < minp1:
        minp2 = minp1
        minp1 = i
    maxp = max(i,maxp)
if min_distance:
    min_distance = minp2 - minp1
max_distance = abs(maxp - minp1)
print(min_distance)
print(max_distance)
0