結果

問題 No.3474 Concat Decimal
コンテスト
ユーザー 👑 ArcAki
提出日時 2026-03-20 22:17:12
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 245 ms / 2,000 ms
コード長 633 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 215 ms
コンパイル使用メモリ 85,268 KB
実行使用メモリ 103,056 KB
最終ジャッジ日時 2026-03-20 22:17:17
合計ジャッジ時間 3,668 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from math import gcd
def main():
    t = int(input())
    need = []
    for i in range(30):
        for j in range(13):
            need.append((2**i)*(5**j))
    need.sort()
    while need[-1] > 1<<30:
        need.pop()
    for _ in range(t):
        n = int(input())
        a = [int(x) for x in input().split()]
        ans = 1
        for v in a[1:]:
            if not v: continue
            t = 10**len(str(v))
            for x in need:
                if (x*v)%t==0:
                    g = gcd(ans, x)
                    ans = ans*x//g
                    break
        print(ans)


if __name__ == "__main__":
    main()
0