結果
問題 | No.736 約比 |
ユーザー |
|
提出日時 | 2022-10-18 14:14:57 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 2,000 ms |
コード長 | 546 bytes |
コンパイル時間 | 290 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-06-28 22:30:02 |
合計ジャッジ時間 | 3,389 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 65 |
ソースコード
def gcd(*numbers: int) -> int:if len(numbers) == 1:return numbers[0]if len(numbers) == 2:a, b = numbersif a < b:a, b = b, awhile True:if a % b == 0:return ba, b = b, a % bfirst_gcd = gcd(*numbers[:2])return gcd(first_gcd, *numbers[2:])def main():_ = input()A = list(map(int, input().split()))gcd_num = gcd(*A)print(":".join(map(lambda num: str(num // gcd_num), A)))if __name__ == "__main__":main()