結果

問題 No.2207 pCr検査
ユーザー 👑 tatyamtatyam
提出日時 2022-07-12 23:58:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 447 bytes
コンパイル時間 492 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 135,976 KB
最終ジャッジ日時 2023-09-15 16:05:18
合計ジャッジ時間 17,907 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,384 KB
testcase_01 WA -
testcase_02 AC 539 ms
104,744 KB
testcase_03 AC 366 ms
97,288 KB
testcase_04 AC 421 ms
96,844 KB
testcase_05 AC 566 ms
112,188 KB
testcase_06 AC 405 ms
87,124 KB
testcase_07 AC 333 ms
91,064 KB
testcase_08 AC 244 ms
88,276 KB
testcase_09 AC 467 ms
104,360 KB
testcase_10 AC 256 ms
78,828 KB
testcase_11 AC 444 ms
102,176 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math
input = sys.stdin.readline

k = int(input())
N = [tuple(map(int, input().split())) for _ in range(k)]
lgN = sum(math.log(p) * e for p, e in N)
p = N[-1][0]
lg_plus = 0.0
lg_minus = 0.0
err = math.inf
r_ans = -1
for r in range(p // 2):
    lg_plus += math.log(p - r)
    lg_minus += math.log(r + 1)
    if err > abs(lg_minus + lgN - lg_plus):
        err = abs(lg_minus + lgN - lg_plus)
        r_ans = r + 1

print(p, r_ans)
0