結果

問題 No.1730 GCD on Blackboard in yukicoder
コンテスト
ユーザー brthyyjp
提出日時 2021-11-06 00:20:15
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 517 ms / 2,000 ms
コード長 325 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 326 ms
コンパイル使用メモリ 84,864 KB
実行使用メモリ 147,968 KB
最終ジャッジ日時 2026-05-08 11:31:49
合計ジャッジ時間 7,373 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n = int(input())
A = list(map(int, input().split()))
from collections import Counter
C = Counter(A)
M = max(A)
X = [0]*n
for g in range(1, M+1):
    j = g
    cnt = 0
    while j <= M:
        cnt += C[j]
        j += g
    if cnt != 0:
        X[n-cnt] = g
ans = 1
for i in range(n):
    ans = max(ans, X[i])
    print(ans)
0