結果

問題 No.1501 酔歩
ユーザー 遭難者遭難者
提出日時 2021-05-07 23:39:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 378 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 10,900 KB
実行使用メモリ 16,160 KB
最終ジャッジ日時 2023-10-13 14:59:26
合計ジャッジ時間 5,716 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,972 KB
testcase_01 AC 16 ms
8,220 KB
testcase_02 AC 16 ms
7,896 KB
testcase_03 AC 16 ms
8,028 KB
testcase_04 AC 16 ms
8,392 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 16 ms
8,256 KB
testcase_14 AC 16 ms
8,268 KB
testcase_15 AC 16 ms
8,372 KB
testcase_16 AC 16 ms
8,336 KB
testcase_17 AC 16 ms
8,344 KB
testcase_18 AC 16 ms
8,196 KB
testcase_19 AC 16 ms
8,344 KB
testcase_20 AC 16 ms
8,212 KB
testcase_21 AC 16 ms
8,200 KB
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 AC 96 ms
16,160 KB
testcase_43 AC 16 ms
8,180 KB
testcase_44 AC 16 ms
8,376 KB
testcase_45 AC 78 ms
10,164 KB
testcase_46 AC 68 ms
10,076 KB
testcase_47 AC 93 ms
10,032 KB
testcase_48 AC 90 ms
13,200 KB
testcase_49 AC 77 ms
13,028 KB
testcase_50 AC 92 ms
13,140 KB
testcase_51 AC 92 ms
13,180 KB
testcase_52 AC 94 ms
13,252 KB
testcase_53 AC 16 ms
8,392 KB
testcase_54 AC 16 ms
7,976 KB
testcase_55 AC 16 ms
8,308 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
assert (p < 10**9)
assert (q < 10**9)
print(str(p) + '/' + str(q))
0