結果

問題 No.766 金魚すくい
ユーザー rlangevin
提出日時 2023-03-09 12:40:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 607 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 82,312 KB
実行使用メモリ 93,948 KB
最終ジャッジ日時 2024-09-18 02:50:59
合計ジャッジ時間 6,561 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 31
権限があれば一括ダウンロードができます

ソースコード

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