結果

問題 No.716 距離
ユーザー brthyyjpbrthyyjp
提出日時 2020-05-06 19:16:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 232 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 76,576 KB
最終ジャッジ日時 2023-09-16 07:26:21
合計ジャッジ時間 5,219 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
76,320 KB
testcase_01 AC 85 ms
76,320 KB
testcase_02 AC 86 ms
76,228 KB
testcase_03 AC 85 ms
76,344 KB
testcase_04 AC 85 ms
76,500 KB
testcase_05 AC 86 ms
76,432 KB
testcase_06 AC 87 ms
76,520 KB
testcase_07 AC 76 ms
71,044 KB
testcase_08 AC 77 ms
71,316 KB
testcase_09 AC 76 ms
71,188 KB
testcase_10 AC 84 ms
76,432 KB
testcase_11 AC 83 ms
76,576 KB
testcase_12 AC 85 ms
76,288 KB
testcase_13 AC 82 ms
76,432 KB
testcase_14 AC 77 ms
71,184 KB
testcase_15 AC 84 ms
76,308 KB
testcase_16 AC 81 ms
76,392 KB
testcase_17 AC 86 ms
76,120 KB
testcase_18 AC 83 ms
75,752 KB
testcase_19 AC 85 ms
76,352 KB
testcase_20 AC 75 ms
71,180 KB
testcase_21 AC 81 ms
75,536 KB
testcase_22 AC 83 ms
76,296 KB
testcase_23 AC 81 ms
75,780 KB
testcase_24 AC 85 ms
76,480 KB
testcase_25 AC 84 ms
76,420 KB
testcase_26 AC 85 ms
76,304 KB
testcase_27 AC 85 ms
76,300 KB
testcase_28 AC 81 ms
75,696 KB
testcase_29 AC 84 ms
76,528 KB
testcase_30 AC 83 ms
76,304 KB
testcase_31 AC 81 ms
76,124 KB
testcase_32 AC 80 ms
76,224 KB
testcase_33 AC 79 ms
76,012 KB
testcase_34 AC 78 ms
76,184 KB
testcase_35 AC 74 ms
71,268 KB
testcase_36 AC 80 ms
76,012 KB
testcase_37 AC 75 ms
71,224 KB
testcase_38 AC 79 ms
76,228 KB
testcase_39 AC 80 ms
76,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))
max_ = -1
min_ = 10**18
for i in range(n-1):
    for j in range(i+1, n):
        max_ = max(max_, abs(A[i]-A[j]))
        min_ = min(min_, abs(A[i]-A[j]))
print(min_)
print(max_)
0