結果
問題 |
No.1501 酔歩
|
ユーザー |
![]() |
提出日時 | 2021-05-07 23:39:19 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 378 bytes |
コンパイル時間 | 375 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 17,408 KB |
最終ジャッジ日時 | 2024-09-15 11:45:07 |
合計ジャッジ時間 | 6,152 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 RE * 28 |
ソースコード
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))