結果

問題 No.1501 酔歩
ユーザー convexineqconvexineq
提出日時 2021-05-07 22:08:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 353 bytes
コンパイル時間 675 ms
コンパイル使用メモリ 87,212 KB
実行使用メモリ 119,268 KB
最終ジャッジ日時 2023-10-13 13:14:58
合計ジャッジ時間 26,416 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 216 ms
88,880 KB
testcase_01 AC 217 ms
88,888 KB
testcase_02 AC 218 ms
88,972 KB
testcase_03 AC 223 ms
89,120 KB
testcase_04 WA -
testcase_05 AC 501 ms
112,236 KB
testcase_06 AC 456 ms
106,596 KB
testcase_07 AC 484 ms
111,908 KB
testcase_08 AC 362 ms
95,900 KB
testcase_09 AC 472 ms
109,076 KB
testcase_10 AC 395 ms
96,648 KB
testcase_11 AC 427 ms
105,964 KB
testcase_12 AC 462 ms
101,612 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 553 ms
118,960 KB
testcase_23 AC 585 ms
119,188 KB
testcase_24 AC 590 ms
119,268 KB
testcase_25 AC 585 ms
118,792 KB
testcase_26 AC 557 ms
119,088 KB
testcase_27 AC 512 ms
119,008 KB
testcase_28 AC 552 ms
119,048 KB
testcase_29 AC 530 ms
119,260 KB
testcase_30 AC 582 ms
119,176 KB
testcase_31 AC 517 ms
119,088 KB
testcase_32 AC 514 ms
118,636 KB
testcase_33 AC 505 ms
118,632 KB
testcase_34 AC 571 ms
119,076 KB
testcase_35 AC 543 ms
119,180 KB
testcase_36 AC 560 ms
119,132 KB
testcase_37 AC 534 ms
118,892 KB
testcase_38 AC 536 ms
118,812 KB
testcase_39 AC 543 ms
118,624 KB
testcase_40 AC 539 ms
118,800 KB
testcase_41 AC 502 ms
118,888 KB
testcase_42 AC 343 ms
118,892 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 332 ms
119,124 KB
testcase_46 AC 339 ms
119,072 KB
testcase_47 AC 341 ms
119,044 KB
testcase_48 AC 502 ms
119,116 KB
testcase_49 AC 503 ms
119,080 KB
testcase_50 AC 506 ms
119,136 KB
testcase_51 AC 538 ms
118,896 KB
testcase_52 AC 504 ms
118,968 KB
testcase_53 WA -
testcase_54 AC 219 ms
89,148 KB
testcase_55 AC 218 ms
88,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from fractions import Fraction as F
n,k = map(int,input().split())
*a, = map(int,input().split())
if k==1:
    print(0)
    exit()
a = [F(0)]+[F(a[i-1],a[i-1]+a[i+1]) for i in range(1,n-1)]+[F(0)]
r = [F(0)]*n
r[1] = F(1)
for i in range(2,n):
    r[i] = (r[i-1]-r[i-2]*a[i-1])/(F(1)-a[i-1])
ans = r[k-1]/r[-1]
print(f"{ans.numerator}/{ans.denominator}")
0