結果

問題 No.766 金魚すくい
ユーザー rlangevinrlangevin
提出日時 2023-03-09 12:40:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 607 bytes
コンパイル時間 237 ms
コンパイル使用メモリ 81,588 KB
実行使用メモリ 93,296 KB
最終ジャッジ日時 2023-10-18 06:14:34
合計ジャッジ時間 6,574 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
62,640 KB
testcase_01 AC 48 ms
62,640 KB
testcase_02 AC 48 ms
62,640 KB
testcase_03 WA -
testcase_04 AC 49 ms
62,640 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
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 AC 54 ms
65,396 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 137 ms
88,320 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 48 ms
62,640 KB
testcase_36 AC 48 ms
62,640 KB
testcase_37 AC 152 ms
88,352 KB
testcase_38 AC 144 ms
88,320 KB
testcase_39 AC 148 ms
88,480 KB
testcase_40 AC 144 ms
88,236 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 48 ms
62,640 KB
testcase_44 AC 48 ms
62,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = 205050
mod = 10 ** 9 + 7
fact = [1] * (n + 1)
invfact = [1] * (n + 1)
for i in range(1, n):
    fact[i + 1] = ((i+1) * fact[i]) % mod
invfact[n] = pow(fact[n], mod - 2, mod)
for i in range(n - 1, -1, -1):
    invfact[i] = invfact[i + 1] * (i + 1) % mod

def comb(n, r):
    if n < 0 or r < 0 or n - r < 0:
        return 0
    return fact[n] * invfact[r] * invfact[n - r] % mod

N, M, P = map(int, input().split())
V = list(map(int, input().split()))

ans = 0
P = P * pow(100, mod - 2, mod) % mod

for i in range(N):
    ans += V[i] * (1 - pow(P, M, mod)) * pow(1 - P, i, mod)
    ans %= mod

print(ans)
0