結果

問題 No.1009 面積の求め方
ユーザー はむ吉🐹はむ吉🐹
提出日時 2020-04-01 15:42:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 317 ms / 2,000 ms
コード長 327 bytes
コンパイル時間 584 ms
コンパイル使用メモリ 10,520 KB
実行使用メモリ 58,736 KB
最終ジャッジ日時 2023-09-09 05:07:16
合計ジャッジ時間 10,357 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 300 ms
58,432 KB
testcase_01 AC 302 ms
58,632 KB
testcase_02 AC 309 ms
58,564 KB
testcase_03 AC 304 ms
58,564 KB
testcase_04 AC 304 ms
58,608 KB
testcase_05 AC 317 ms
58,484 KB
testcase_06 AC 314 ms
58,364 KB
testcase_07 AC 310 ms
58,620 KB
testcase_08 AC 305 ms
58,520 KB
testcase_09 AC 302 ms
58,520 KB
testcase_10 AC 306 ms
58,692 KB
testcase_11 AC 303 ms
58,536 KB
testcase_12 AC 304 ms
58,560 KB
testcase_13 AC 305 ms
58,508 KB
testcase_14 AC 312 ms
58,444 KB
testcase_15 AC 304 ms
58,484 KB
testcase_16 AC 300 ms
58,604 KB
testcase_17 AC 308 ms
58,468 KB
testcase_18 AC 315 ms
58,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

import scipy.integrate


def compute_area(a, b):
    res = scipy.integrate.fixed_quad(lambda x: -(x - a) * (x - b), a, b)
    return res[0]


def main():
    a, b = (int(z) for z in input().split())
    area = compute_area(a, b)
    print("{:.12f}".format(area))


if __name__ == "__main__":
    main()
0