結果

問題 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
コンパイル時間 82 ms
コンパイル使用メモリ 10,624 KB
実行使用メモリ 8,348 KB
最終ジャッジ日時 2023-08-18 16:06:42
合計ジャッジ時間 2,178 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
8,216 KB
testcase_01 AC 14 ms
8,272 KB
testcase_02 AC 13 ms
8,228 KB
testcase_03 AC 16 ms
8,212 KB
testcase_04 AC 15 ms
8,272 KB
testcase_05 AC 14 ms
8,348 KB
testcase_06 AC 14 ms
8,312 KB
testcase_07 AC 13 ms
7,820 KB
testcase_08 AC 13 ms
7,908 KB
testcase_09 AC 13 ms
7,936 KB
testcase_10 AC 13 ms
8,348 KB
testcase_11 WA -
testcase_12 AC 14 ms
8,300 KB
testcase_13 AC 13 ms
7,952 KB
testcase_14 WA -
testcase_15 AC 13 ms
8,208 KB
testcase_16 WA -
testcase_17 AC 14 ms
8,220 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 13 ms
8,236 KB
testcase_25 AC 14 ms
7,912 KB
testcase_26 WA -
testcase_27 AC 13 ms
7,768 KB
testcase_28 WA -
testcase_29 AC 14 ms
7,828 KB
testcase_30 WA -
testcase_31 AC 14 ms
8,216 KB
testcase_32 AC 13 ms
7,776 KB
testcase_33 WA -
testcase_34 AC 13 ms
7,768 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 15 ms
7,820 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