結果

問題 No.1730 GCD on Blackboard in yukicoder
ユーザー brthyyjpbrthyyjp
提出日時 2021-11-06 00:20:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 999 ms / 2,000 ms
コード長 325 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 87,168 KB
実行使用メモリ 118,424 KB
最終ジャッジ日時 2023-08-07 23:26:13
合計ジャッジ時間 12,586 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 315 ms
107,844 KB
testcase_01 AC 103 ms
71,576 KB
testcase_02 AC 237 ms
76,968 KB
testcase_03 AC 340 ms
77,216 KB
testcase_04 AC 339 ms
77,196 KB
testcase_05 AC 336 ms
77,260 KB
testcase_06 AC 338 ms
77,260 KB
testcase_07 AC 344 ms
77,416 KB
testcase_08 AC 94 ms
71,560 KB
testcase_09 AC 212 ms
77,168 KB
testcase_10 AC 256 ms
77,152 KB
testcase_11 AC 94 ms
71,520 KB
testcase_12 AC 94 ms
71,608 KB
testcase_13 AC 792 ms
114,448 KB
testcase_14 AC 791 ms
114,396 KB
testcase_15 AC 999 ms
114,440 KB
testcase_16 AC 861 ms
114,540 KB
testcase_17 AC 781 ms
114,488 KB
testcase_18 AC 286 ms
118,424 KB
testcase_19 AC 494 ms
117,888 KB
testcase_20 AC 338 ms
106,436 KB
testcase_21 AC 340 ms
106,384 KB
testcase_22 AC 272 ms
108,048 KB
testcase_23 AC 164 ms
105,988 KB
testcase_24 AC 317 ms
106,116 KB
testcase_25 AC 700 ms
118,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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