結果

問題 No.731 等差数列がだいすき
ユーザー tktk_snsntktk_snsn
提出日時 2021-03-19 19:26:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 516 ms / 1,500 ms
コード長 227 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 45,472 KB
最終ジャッジ日時 2024-04-29 12:07:28
合計ジャッジ時間 13,955 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 503 ms
45,208 KB
testcase_01 AC 503 ms
45,084 KB
testcase_02 AC 492 ms
45,460 KB
testcase_03 AC 504 ms
45,468 KB
testcase_04 AC 510 ms
45,216 KB
testcase_05 AC 500 ms
45,344 KB
testcase_06 AC 498 ms
45,080 KB
testcase_07 AC 504 ms
45,340 KB
testcase_08 AC 508 ms
44,948 KB
testcase_09 AC 508 ms
45,080 KB
testcase_10 AC 516 ms
45,208 KB
testcase_11 AC 509 ms
45,472 KB
testcase_12 AC 501 ms
45,340 KB
testcase_13 AC 502 ms
44,952 KB
testcase_14 AC 499 ms
45,084 KB
testcase_15 AC 502 ms
45,084 KB
testcase_16 AC 499 ms
45,208 KB
testcase_17 AC 499 ms
45,464 KB
testcase_18 AC 500 ms
45,464 KB
testcase_19 AC 504 ms
45,448 KB
testcase_20 AC 507 ms
45,084 KB
権限があれば一括ダウンロードができます

ソースコード

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