結果
問題 |
No.280 歯車の問題(1)
|
ユーザー |
![]() |
提出日時 | 2024-02-04 21:10:42 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 41 ms / 1,000 ms |
コード長 | 282 bytes |
コンパイル時間 | 321 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 52,480 KB |
最終ジャッジ日時 | 2024-09-28 11:20:51 |
合計ジャッジ時間 | 4,007 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
from math import gcd N = int(input()) Z = list(map(int, input().split())) z0 = Z[0] mother = 1 daughter = 1 for i in range(1, N): mother *= Z[i] daughter *= Z[i - 1] g = gcd(mother, daughter) mother //= g daughter //= g print(str(mother) + "/" + str(daughter))