結果
問題 |
No.1501 酔歩
|
ユーザー |
![]() |
提出日時 | 2021-05-07 13:18:54 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 306 bytes |
コンパイル時間 | 125 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 17,320 KB |
最終ジャッジ日時 | 2024-09-15 01:48:18 |
合計ジャッジ時間 | 5,898 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 52 WA * 1 |
ソースコード
import math n, k = map(int,input().split()) a = list(map(int,input().split())) l = 6350400 if(n == 1): print("1/1") 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))