結果

問題 No.1501 酔歩
ユーザー H3PO4H3PO4
提出日時 2023-10-08 10:21:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 438 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 16,572 KB
最終ジャッジ日時 2023-10-08 10:21:43
合計ジャッジ時間 7,027 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,920 KB
testcase_01 AC 15 ms
8,364 KB
testcase_02 AC 15 ms
7,916 KB
testcase_03 AC 15 ms
8,004 KB
testcase_04 WA -
testcase_05 AC 63 ms
13,108 KB
testcase_06 AC 52 ms
11,828 KB
testcase_07 AC 63 ms
12,900 KB
testcase_08 AC 26 ms
9,292 KB
testcase_09 AC 55 ms
12,492 KB
testcase_10 AC 33 ms
9,832 KB
testcase_11 AC 50 ms
11,940 KB
testcase_12 AC 41 ms
10,896 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 78 ms
14,592 KB
testcase_23 AC 80 ms
14,716 KB
testcase_24 AC 77 ms
14,728 KB
testcase_25 AC 78 ms
14,736 KB
testcase_26 AC 79 ms
14,736 KB
testcase_27 AC 79 ms
14,792 KB
testcase_28 AC 78 ms
14,608 KB
testcase_29 AC 79 ms
14,656 KB
testcase_30 AC 79 ms
14,772 KB
testcase_31 AC 77 ms
14,720 KB
testcase_32 AC 77 ms
14,660 KB
testcase_33 AC 79 ms
14,732 KB
testcase_34 AC 78 ms
14,732 KB
testcase_35 AC 79 ms
14,672 KB
testcase_36 AC 79 ms
14,612 KB
testcase_37 AC 80 ms
14,764 KB
testcase_38 AC 77 ms
14,616 KB
testcase_39 AC 81 ms
14,780 KB
testcase_40 AC 80 ms
14,780 KB
testcase_41 AC 78 ms
14,772 KB
testcase_42 AC 84 ms
16,572 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 80 ms
14,456 KB
testcase_46 AC 78 ms
14,496 KB
testcase_47 AC 78 ms
14,500 KB
testcase_48 AC 83 ms
14,612 KB
testcase_49 AC 83 ms
14,744 KB
testcase_50 AC 83 ms
14,752 KB
testcase_51 AC 84 ms
14,640 KB
testcase_52 AC 83 ms
14,620 KB
testcase_53 WA -
testcase_54 AC 15 ms
7,956 KB
testcase_55 AC 16 ms
8,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd, lcm

N, K = map(int, input().split())
A = list(map(int, input().split()))

if K == 1:
    print(0)
    exit()

lcm_all = lcm(*((i * j) for i in range(1, 11) for j in range(1, 11)))

dp = [0] * N
for i in range(N - 1):
    dp[i + 1] = dp[i] + lcm_all // (A[i] * A[i + 1])
denominator = dp[-1]
numerator = dp[K - 1]
g = gcd(numerator, denominator)
denominator //= g
numerator //= g
print(f"{numerator}/{denominator}")
0