結果
問題 | No.135 とりあえず1次元の問題 |
ユーザー |
![]() |
提出日時 | 2020-03-29 20:43:16 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 131 ms / 5,000 ms |
コード長 | 249 bytes |
コンパイル時間 | 276 ms |
コンパイル使用メモリ | 12,032 KB |
実行使用メモリ | 20,268 KB |
最終ジャッジ日時 | 2025-01-02 15:46:49 |
合計ジャッジ時間 | 2,934 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
import sys input=lambda: sys.stdin.readline().rstrip() n=int(input()) X=sorted([int(i) for i in input().split()]) ans=float("inf") for i in range(n-1): d=X[i+1]-X[i] if d>0: ans=min(d,ans) if ans==float("inf"): print(0) else: print(ans)