結果

問題 No.1009 面積の求め方
ユーザー はむ吉🐹はむ吉🐹
提出日時 2020-04-01 15:36:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,765 ms / 2,000 ms
コード長 321 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 102,984 KB
最終ジャッジ日時 2023-09-09 04:54:11
合計ジャッジ時間 11,696 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,765 ms
57,600 KB
testcase_01 AC 295 ms
57,716 KB
testcase_02 AC 296 ms
57,700 KB
testcase_03 AC 293 ms
57,884 KB
testcase_04 AC 293 ms
57,828 KB
testcase_05 AC 291 ms
57,784 KB
testcase_06 AC 293 ms
57,588 KB
testcase_07 AC 294 ms
57,796 KB
testcase_08 AC 292 ms
57,716 KB
testcase_09 AC 293 ms
57,732 KB
testcase_10 AC 295 ms
57,696 KB
testcase_11 AC 294 ms
57,712 KB
testcase_12 AC 294 ms
57,744 KB
testcase_13 AC 299 ms
57,720 KB
testcase_14 AC 297 ms
57,628 KB
testcase_15 AC 296 ms
57,604 KB
testcase_16 AC 297 ms
57,468 KB
testcase_17 AC 293 ms
57,748 KB
testcase_18 AC 295 ms
102,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

import scipy.integrate


def compute_area(a, b):
    res = scipy.integrate.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