結果

問題 No.2461 一点張り
ユーザー 👑 timitimi
提出日時 2023-09-08 22:06:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 323 bytes
コンパイル時間 780 ms
コンパイル使用メモリ 10,592 KB
実行使用メモリ 9,180 KB
最終ジャッジ日時 2023-09-08 22:06:41
合計ジャッジ時間 2,958 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
9,124 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 790 ms
9,148 KB
testcase_06 WA -
testcase_07 AC 42 ms
8,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
from decimal import Decimal
for _ in range(N):
  x,y=input().split()
  y=int(y)
  if x[-2]=='.':
    x=x+'00'
  elif x[-2]=='.':
    x=x+'0'
  x=int(x.replace('.',''))
  ans=0;c=1
  for i in range(1,y):
    d=Decimal(c*x)/Decimal(1000) 
    ans+=i*d 
    c-=d
    if c<0.0000001:
      break
  print(ans+y*c)
0