結果

問題 No.2516 Credit Creation
ユーザー hato336
提出日時 2023-10-28 08:48:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 535 bytes
コンパイル時間 229 ms
コンパイル使用メモリ 82,456 KB
実行使用メモリ 89,212 KB
最終ジャッジ日時 2024-09-25 16:11:36
合計ジャッジ時間 2,483 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
n = int(input())
#alist = list(map(int,input().split()))
#alist = []
#s = input()
#n,m = map(int,input().split())
#for i in range(n):
#    alist.append(list(map(int,input().split())))
r = decimal.Decimal(input())
ans = [decimal.Decimal(100) for i in range(n)]
a = 0
for i in range(n):
    a += ans[i]
    if i != n-1:
        ans[i+1] = (decimal.Decimal(1) - r)*ans[i]
print(a)
0