結果

問題 No.1730 GCD on Blackboard in yukicoder
ユーザー brthyyjpbrthyyjp
提出日時 2021-11-06 00:21:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 331 ms / 2,000 ms
コード長 308 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 82,356 KB
実行使用メモリ 152,816 KB
最終ジャッジ日時 2024-04-25 17:37:35
合計ジャッジ時間 7,989 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 309 ms
152,548 KB
testcase_01 AC 40 ms
53,492 KB
testcase_02 AC 239 ms
119,012 KB
testcase_03 AC 250 ms
118,892 KB
testcase_04 AC 239 ms
119,376 KB
testcase_05 AC 251 ms
118,984 KB
testcase_06 AC 238 ms
118,508 KB
testcase_07 AC 248 ms
118,928 KB
testcase_08 AC 40 ms
54,980 KB
testcase_09 AC 187 ms
104,680 KB
testcase_10 AC 192 ms
104,552 KB
testcase_11 AC 40 ms
53,628 KB
testcase_12 AC 38 ms
53,824 KB
testcase_13 AC 331 ms
152,648 KB
testcase_14 AC 323 ms
152,620 KB
testcase_15 AC 321 ms
152,816 KB
testcase_16 AC 323 ms
152,408 KB
testcase_17 AC 320 ms
152,344 KB
testcase_18 AC 160 ms
114,076 KB
testcase_19 AC 322 ms
152,484 KB
testcase_20 AC 260 ms
136,968 KB
testcase_21 AC 254 ms
136,916 KB
testcase_22 AC 256 ms
138,380 KB
testcase_23 AC 100 ms
106,080 KB
testcase_24 AC 285 ms
149,540 KB
testcase_25 AC 312 ms
152,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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