結果
| 問題 |
No.2461 一点張り
|
| コンテスト | |
| ユーザー |
mymelochan
|
| 提出日時 | 2023-09-08 21:27:42 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 77 ms / 2,000 ms |
| コード長 | 677 bytes |
| コンパイル時間 | 206 ms |
| コンパイル使用メモリ | 82,816 KB |
| 実行使用メモリ | 77,056 KB |
| 最終ジャッジ日時 | 2024-06-26 14:18:13 |
| 合計ジャッジ時間 | 1,269 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 7 |
ソースコード
#############################################################
import sys
sys.setrecursionlimit(10**7)
from heapq import heappop,heappush
from collections import deque,defaultdict,Counter
from bisect import bisect_left, bisect_right
from itertools import product,combinations,permutations
ipt = sys.stdin.readline
def iin():
return int(ipt())
def lmin():
return list(map(int,ipt().split()))
MOD = 998244353
#############################################################
for _ in range(iin()):
p,K = input().split()
p = float(p)
K = int(K)
t = 1
ans = 0
for i in range(1,K):
ans += t*p*i
t *= 1-p
ans += t*K
print(ans)
mymelochan