結果

問題 No.1730 GCD on Blackboard in yukicoder
ユーザー brthyyjpbrthyyjp
提出日時 2021-11-06 00:20:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 703 ms / 2,000 ms
コード長 325 bytes
コンパイル時間 407 ms
コンパイル使用メモリ 82,256 KB
実行使用メモリ 114,772 KB
最終ジャッジ日時 2024-04-25 17:37:46
合計ジャッジ時間 9,882 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 256 ms
106,688 KB
testcase_01 AC 39 ms
54,592 KB
testcase_02 AC 183 ms
62,688 KB
testcase_03 AC 276 ms
64,756 KB
testcase_04 AC 276 ms
64,960 KB
testcase_05 AC 279 ms
65,472 KB
testcase_06 AC 281 ms
64,804 KB
testcase_07 AC 288 ms
64,672 KB
testcase_08 AC 40 ms
54,384 KB
testcase_09 AC 160 ms
63,828 KB
testcase_10 AC 209 ms
64,396 KB
testcase_11 AC 39 ms
53,544 KB
testcase_12 AC 39 ms
54,000 KB
testcase_13 AC 646 ms
111,248 KB
testcase_14 AC 650 ms
111,504 KB
testcase_15 AC 679 ms
111,260 KB
testcase_16 AC 703 ms
111,280 KB
testcase_17 AC 631 ms
111,300 KB
testcase_18 AC 210 ms
113,716 KB
testcase_19 AC 405 ms
114,772 KB
testcase_20 AC 285 ms
105,340 KB
testcase_21 AC 287 ms
105,152 KB
testcase_22 AC 221 ms
106,584 KB
testcase_23 AC 106 ms
105,524 KB
testcase_24 AC 250 ms
105,556 KB
testcase_25 AC 448 ms
113,720 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