結果

問題 No.736 約比
ユーザー URechaRechaURechaRecha
提出日時 2019-09-09 16:47:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 708 bytes
コンパイル時間 948 ms
コンパイル使用メモリ 10,848 KB
実行使用メモリ 8,020 KB
最終ジャッジ日時 2023-09-10 21:35:56
合計ジャッジ時間 5,204 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,936 KB
testcase_01 AC 16 ms
7,952 KB
testcase_02 AC 17 ms
7,792 KB
testcase_03 AC 16 ms
7,868 KB
testcase_04 AC 17 ms
7,864 KB
testcase_05 AC 16 ms
7,956 KB
testcase_06 AC 16 ms
7,864 KB
testcase_07 AC 16 ms
7,876 KB
testcase_08 AC 16 ms
7,864 KB
testcase_09 AC 16 ms
7,884 KB
testcase_10 AC 16 ms
7,892 KB
testcase_11 AC 16 ms
7,812 KB
testcase_12 AC 16 ms
7,828 KB
testcase_13 AC 16 ms
7,816 KB
testcase_14 WA -
testcase_15 AC 17 ms
7,860 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 16 ms
7,872 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 16 ms
7,944 KB
testcase_23 AC 16 ms
7,888 KB
testcase_24 AC 16 ms
7,812 KB
testcase_25 WA -
testcase_26 AC 16 ms
7,952 KB
testcase_27 AC 17 ms
7,796 KB
testcase_28 AC 16 ms
7,820 KB
testcase_29 AC 16 ms
7,816 KB
testcase_30 AC 16 ms
7,868 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 16 ms
7,812 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 16 ms
7,816 KB
testcase_37 AC 16 ms
7,976 KB
testcase_38 AC 16 ms
7,892 KB
testcase_39 AC 16 ms
7,872 KB
testcase_40 AC 18 ms
7,876 KB
testcase_41 AC 16 ms
7,792 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
testcase_61 WA -
testcase_62 AC 16 ms
7,928 KB
testcase_63 AC 16 ms
7,864 KB
testcase_64 AC 16 ms
7,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
e =list(map(int,input().split()))
def f(num):
    for i in range(n):
        e[i] //=num
bl2 = 1#2で約比可能か
bli = 1#3以上の奇数で約比可能か
#0番目の要素を約分
divs = []
a = e[0]
while bl2 or bli :
    if bl2:
        if a%2 ==0:
            a //=2
            divs.append(2)
            continue
        else:
            bl2 =0
    for i in range(3,int(a**(-2))+2,2):
        if a%i ==0:
            a //=i
            divs.append(3)
            continue
    else:
        bli =0
divs.append(a)
while len(divs) >0:
    bl =1
    d = divs.pop(0)
    for i in range(1,n):
        if e[i] % d >=1:
            bl =0
    if bl:
        f(d)
print(":".join(map(str,e)))
0