結果

問題 No.1730 GCD on Blackboard in yukicoder
ユーザー るさるさ
提出日時 2021-08-17 17:17:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 650 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 82,164 KB
実行使用メモリ 183,644 KB
最終ジャッジ日時 2024-04-25 17:12:07
合計ジャッジ時間 18,254 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 621 ms
183,140 KB
testcase_01 AC 554 ms
151,512 KB
testcase_02 AC 582 ms
166,344 KB
testcase_03 AC 563 ms
166,436 KB
testcase_04 AC 575 ms
166,204 KB
testcase_05 AC 600 ms
166,488 KB
testcase_06 AC 582 ms
166,192 KB
testcase_07 AC 584 ms
166,376 KB
testcase_08 AC 579 ms
181,932 KB
testcase_09 AC 578 ms
166,244 KB
testcase_10 AC 555 ms
166,168 KB
testcase_11 AC 588 ms
151,872 KB
testcase_12 AC 580 ms
151,604 KB
testcase_13 AC 650 ms
183,500 KB
testcase_14 AC 646 ms
183,348 KB
testcase_15 AC 633 ms
183,408 KB
testcase_16 AC 644 ms
183,644 KB
testcase_17 AC 644 ms
183,584 KB
testcase_18 AC 627 ms
157,436 KB
testcase_19 AC 636 ms
183,396 KB
testcase_20 AC 617 ms
156,576 KB
testcase_21 AC 638 ms
156,828 KB
testcase_22 AC 642 ms
183,204 KB
testcase_23 AC 610 ms
178,128 KB
testcase_24 AC 606 ms
155,980 KB
testcase_25 AC 595 ms
157,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
max_a = 2200000

al = [0] * max_a
for i in a:
    al[i] += 1

ans = [-1] * (n+1)
for i in range(max_a, 0, -1):
    t = n - sum(al[i::i])
    if ans[t] == -1:
        ans[t] = i
    
mx = -1
for i in range(0, n):
    if mx < ans[i]:
        mx = ans[i]
    print(mx)
0