結果

問題 No.736 約比
ユーザー fV9TwBhUoa9S3eV
提出日時 2019-10-25 10:06:43
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 426 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 17,696 KB
最終ジャッジ日時 2024-07-19 06:30:26
合計ジャッジ時間 4,059 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 1 TLE * 1 -- * 59
権限があれば一括ダウンロードができます

ソースコード

diff #

# No.736 約比
n = int(input())
a = [int(s) for s in input().split()]
b = []

if 1 in a:
    print(a)
else:
    for i in range(min(a), 2, -1):
        for j in a:
            if j % i == 0:
                b.append(j // i)
            else:
                b = []
                break
        else:
            a = b
    
    answer = str(a[0])

    for i in range(1, n):
        answer += ':' + str(a[i])

    print(answer)
0