結果

問題 No.1730 GCD on Blackboard in yukicoder
コンテスト
ユーザー SidewaysOwl
提出日時 2021-11-05 22:04:54
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 536 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 212 ms
コンパイル使用メモリ 85,672 KB
実行使用メモリ 153,720 KB
最終ジャッジ日時 2026-05-06 17:06:33
合計ジャッジ時間 14,508 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n = int(input())
a = list(map(int,input().split()))
from collections import defaultdict
d = defaultdict(int)
import math
# ans = a[0]
for i in range(n):
    l = set()
    j = 1
    while j ** 2 <= a[i]:
        if a[i] % j == 0:
            if not j ** 2 == a[i]:
                d[j] += 1
                d[a[i]//j] += 1
            else:
                d[j] += 1
        j += 1
d2 = defaultdict(int)
for k in d.keys():
    d2[d[k]] = max(d2[d[k]],k)
ans = 1
for i in range(n):
    if (n-i) in d2:
        ans = d2[n-i]
    print(ans)
0