結果

問題 No.731 等差数列がだいすき
ユーザー tktk_snsn
提出日時 2021-03-19 19:26:14
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 500 ms / 1,500 ms
コード長 227 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 47,068 KB
最終ジャッジ日時 2024-11-18 15:16:02
合計ジャッジ時間 13,592 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
n = int(input())
x = np.arange(n)
y = np.array(input().split(), dtype=np.intc)
(b, a), error, _, _, _ = np.polyfit(x, y, deg=1, full=True)
print("{:.12f} {:.12f}".format(a, b))
print("{:.12f}".format(*error))
0