結果

問題 No.1730 GCD on Blackboard in yukicoder
ユーザー るさるさ
提出日時 2021-08-17 17:17:44
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 654 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 187,060 KB
最終ジャッジ日時 2023-08-07 22:54:41
合計ジャッジ時間 18,328 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 621 ms
163,324 KB
testcase_01 AC 544 ms
145,664 KB
testcase_02 AC 558 ms
169,116 KB
testcase_03 AC 584 ms
169,344 KB
testcase_04 AC 561 ms
169,244 KB
testcase_05 AC 578 ms
168,852 KB
testcase_06 AC 583 ms
168,920 KB
testcase_07 AC 584 ms
168,928 KB
testcase_08 AC 571 ms
182,848 KB
testcase_09 AC 566 ms
168,924 KB
testcase_10 AC 559 ms
169,168 KB
testcase_11 AC 547 ms
138,436 KB
testcase_12 AC 532 ms
138,420 KB
testcase_13 AC 621 ms
186,936 KB
testcase_14 AC 628 ms
186,676 KB
testcase_15 AC 624 ms
186,876 KB
testcase_16 AC 632 ms
187,060 KB
testcase_17 AC 654 ms
186,768 KB
testcase_18 AC 630 ms
187,016 KB
testcase_19 AC 611 ms
159,620 KB
testcase_20 AC 602 ms
158,476 KB
testcase_21 AC 591 ms
157,700 KB
testcase_22 AC 597 ms
163,260 KB
testcase_23 AC 581 ms
180,848 KB
testcase_24 AC 608 ms
183,484 KB
testcase_25 AC 603 ms
156,912 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