結果

問題 No.1501 酔歩
ユーザー 遭難者遭難者
提出日時 2021-05-07 13:13:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 340 bytes
コンパイル時間 404 ms
コンパイル使用メモリ 10,636 KB
実行使用メモリ 16,820 KB
最終ジャッジ日時 2023-10-13 04:11:12
合計ジャッジ時間 6,301 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,988 KB
testcase_01 AC 16 ms
8,404 KB
testcase_02 AC 16 ms
7,908 KB
testcase_03 AC 16 ms
7,976 KB
testcase_04 AC 17 ms
8,356 KB
testcase_05 AC 62 ms
10,120 KB
testcase_06 AC 51 ms
9,652 KB
testcase_07 AC 59 ms
9,984 KB
testcase_08 AC 29 ms
8,744 KB
testcase_09 AC 53 ms
10,004 KB
testcase_10 AC 33 ms
9,024 KB
testcase_11 AC 45 ms
9,548 KB
testcase_12 AC 49 ms
9,216 KB
testcase_13 AC 16 ms
8,288 KB
testcase_14 AC 17 ms
8,284 KB
testcase_15 AC 16 ms
8,404 KB
testcase_16 AC 16 ms
8,244 KB
testcase_17 AC 17 ms
8,332 KB
testcase_18 AC 17 ms
8,400 KB
testcase_19 AC 16 ms
8,360 KB
testcase_20 AC 16 ms
8,396 KB
testcase_21 AC 16 ms
8,404 KB
testcase_22 AC 80 ms
10,644 KB
testcase_23 AC 74 ms
10,632 KB
testcase_24 AC 76 ms
10,596 KB
testcase_25 AC 85 ms
10,500 KB
testcase_26 AC 87 ms
10,596 KB
testcase_27 AC 81 ms
10,444 KB
testcase_28 AC 71 ms
10,456 KB
testcase_29 AC 85 ms
10,488 KB
testcase_30 AC 64 ms
10,600 KB
testcase_31 AC 89 ms
10,612 KB
testcase_32 AC 85 ms
10,484 KB
testcase_33 AC 74 ms
10,448 KB
testcase_34 AC 78 ms
10,540 KB
testcase_35 AC 83 ms
10,500 KB
testcase_36 AC 76 ms
10,488 KB
testcase_37 AC 91 ms
10,480 KB
testcase_38 AC 87 ms
10,456 KB
testcase_39 AC 66 ms
10,660 KB
testcase_40 AC 87 ms
10,468 KB
testcase_41 AC 73 ms
10,496 KB
testcase_42 AC 98 ms
16,820 KB
testcase_43 AC 16 ms
8,404 KB
testcase_44 AC 16 ms
8,244 KB
testcase_45 AC 79 ms
10,204 KB
testcase_46 AC 71 ms
10,152 KB
testcase_47 AC 94 ms
10,224 KB
testcase_48 AC 92 ms
13,020 KB
testcase_49 AC 77 ms
13,172 KB
testcase_50 AC 95 ms
13,032 KB
testcase_51 AC 91 ms
13,068 KB
testcase_52 AC 94 ms
13,128 KB
testcase_53 AC 17 ms
8,248 KB
testcase_54 AC 16 ms
8,096 KB
testcase_55 AC 16 ms
8,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
n, k = map(int,input().split())
a = list(map(int,input().split()))
l = 6350400
if(n == 1):
  print("1/1")
  exit()
if(k == 1):
  print("0")
  exit()
p = q = 0
for i in range(k - 1):
  p += l // (a[i] * a[i + 1])
for i in range(n - 1):
  q += l // (a[i] * a[i + 1])
l = math.gcd(p, q)
p //= l
q //= l
print(str(p) + '/' + str(q))
0