結果
| 問題 | No.736 約比 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-01-23 17:33:37 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 30 ms / 2,000 ms | 
| コード長 | 483 bytes | 
| コンパイル時間 | 89 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 10,880 KB | 
| 最終ジャッジ日時 | 2024-07-19 11:23:18 | 
| 合計ジャッジ時間 | 3,498 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 65 | 
ソースコード
# yukicoder No.736 約比 2020/01/23
from functools import reduce
try:
    from math import gcd
except:
    from fractions import gcd
class GCD:
    def __init__(self,arg):
        if type(arg) in [list,tuple]:
            self.arr=arg
        self.gcd=self.gcd_list(self.arr)
    def gcd_list(self,arr):
        return reduce(gcd,arr)
            
n=int(input())
a=list(map(int,input().split()))
_gcd=GCD(a)
ans=list(map(lambda x: str(x//_gcd.gcd),a))
print(':'.join(ans))
            
            
            
        