結果

問題 No.716 距離
ユーザー DrDrpilotDrDrpilot
提出日時 2022-01-28 17:56:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 252 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 87,160 KB
実行使用メモリ 76,356 KB
最終ジャッジ日時 2023-08-28 15:20:07
合計ジャッジ時間 4,910 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
76,000 KB
testcase_01 AC 79 ms
76,288 KB
testcase_02 AC 79 ms
76,044 KB
testcase_03 AC 80 ms
76,096 KB
testcase_04 AC 80 ms
76,092 KB
testcase_05 AC 78 ms
76,356 KB
testcase_06 AC 79 ms
76,076 KB
testcase_07 AC 69 ms
71,144 KB
testcase_08 AC 70 ms
71,036 KB
testcase_09 AC 70 ms
71,372 KB
testcase_10 AC 78 ms
76,236 KB
testcase_11 AC 78 ms
75,828 KB
testcase_12 AC 81 ms
76,076 KB
testcase_13 AC 79 ms
75,996 KB
testcase_14 AC 71 ms
71,288 KB
testcase_15 AC 79 ms
76,092 KB
testcase_16 AC 77 ms
76,096 KB
testcase_17 AC 79 ms
76,292 KB
testcase_18 AC 74 ms
75,704 KB
testcase_19 AC 77 ms
76,144 KB
testcase_20 AC 71 ms
71,288 KB
testcase_21 AC 77 ms
75,700 KB
testcase_22 AC 78 ms
76,060 KB
testcase_23 AC 77 ms
75,588 KB
testcase_24 AC 79 ms
76,052 KB
testcase_25 AC 79 ms
76,076 KB
testcase_26 AC 78 ms
76,128 KB
testcase_27 AC 79 ms
76,204 KB
testcase_28 AC 75 ms
75,476 KB
testcase_29 AC 80 ms
76,236 KB
testcase_30 AC 78 ms
76,060 KB
testcase_31 AC 79 ms
76,100 KB
testcase_32 AC 78 ms
76,044 KB
testcase_33 AC 78 ms
76,096 KB
testcase_34 AC 78 ms
76,100 KB
testcase_35 AC 71 ms
71,032 KB
testcase_36 AC 77 ms
76,040 KB
testcase_37 AC 71 ms
71,260 KB
testcase_38 AC 77 ms
76,232 KB
testcase_39 AC 78 ms
76,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
ans_min=float('inf')
ans_max=0
for i in range(n):
    for j in range(i+1,n):
        x=a[i];y=a[j]
        ans_min=min(ans_min,abs(x-y))
        ans_max=max(ans_max,abs(x-y))
print(ans_min)
print(ans_max)
0