結果

問題 No.2461 一点張り
ユーザー 👑 timitimi
提出日時 2023-09-08 22:05:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 291 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 10,604 KB
実行使用メモリ 9,132 KB
最終ジャッジ日時 2023-09-08 22:05:42
合計ジャッジ時間 4,450 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
8,928 KB
testcase_01 WA -
testcase_02 AC 410 ms
8,792 KB
testcase_03 AC 800 ms
8,928 KB
testcase_04 WA -
testcase_05 AC 613 ms
8,944 KB
testcase_06 AC 401 ms
8,952 KB
testcase_07 AC 36 ms
8,992 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
  print(ans+y*c)
0