結果

問題 No.1730 GCD on Blackboard in yukicoder
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2021-11-14 11:09:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 255 ms / 2,000 ms
コード長 311 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 82,460 KB
実行使用メモリ 152,900 KB
最終ジャッジ日時 2024-04-25 17:51:01
合計ジャッジ時間 6,455 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 251 ms
152,104 KB
testcase_01 AC 33 ms
52,028 KB
testcase_02 AC 185 ms
119,448 KB
testcase_03 AC 190 ms
119,344 KB
testcase_04 AC 194 ms
119,280 KB
testcase_05 AC 186 ms
119,572 KB
testcase_06 AC 186 ms
119,060 KB
testcase_07 AC 183 ms
119,516 KB
testcase_08 AC 36 ms
54,468 KB
testcase_09 AC 140 ms
105,364 KB
testcase_10 AC 143 ms
105,020 KB
testcase_11 AC 33 ms
53,148 KB
testcase_12 AC 33 ms
53,360 KB
testcase_13 AC 246 ms
152,900 KB
testcase_14 AC 239 ms
152,476 KB
testcase_15 AC 246 ms
152,532 KB
testcase_16 AC 246 ms
152,220 KB
testcase_17 AC 246 ms
152,716 KB
testcase_18 AC 129 ms
114,196 KB
testcase_19 AC 255 ms
152,208 KB
testcase_20 AC 201 ms
136,532 KB
testcase_21 AC 198 ms
136,708 KB
testcase_22 AC 211 ms
138,288 KB
testcase_23 AC 100 ms
105,956 KB
testcase_24 AC 248 ms
149,604 KB
testcase_25 AC 252 ms
151,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))
cnt = [0]*(max(A)+1)
for a in A:
    cnt[a] += 1
ans = [1]*(N+1)
mA = max(A)
for i in range(1,mA+1):
    tmp = 0
    for c in cnt[::i]:
        tmp += c
    ans[tmp] = max(i,ans[tmp])
    
tmp = 1
for i in range(N):
    tmp = max(tmp,ans[-1-i])
    print(tmp)
0