結果
| 問題 |
No.1501 酔歩
|
| コンテスト | |
| ユーザー |
遭難者
|
| 提出日時 | 2021-05-07 13:13:53 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 121 ms / 2,000 ms |
| コード長 | 340 bytes |
| コンパイル時間 | 377 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 17,128 KB |
| 最終ジャッジ日時 | 2024-09-15 01:46:48 |
| 合計ジャッジ時間 | 6,423 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 53 |
ソースコード
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))
遭難者