結果

問題 No.1730 GCD on Blackboard in yukicoder
ユーザー lloyzlloyz
提出日時 2021-11-09 23:20:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 324 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 346 ms
コンパイル使用メモリ 82,732 KB
実行使用メモリ 152,828 KB
最終ジャッジ日時 2024-04-25 17:49:23
合計ジャッジ時間 7,503 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 324 ms
152,228 KB
testcase_01 AC 34 ms
52,684 KB
testcase_02 AC 231 ms
118,952 KB
testcase_03 AC 230 ms
119,068 KB
testcase_04 AC 237 ms
118,936 KB
testcase_05 AC 249 ms
118,932 KB
testcase_06 AC 241 ms
118,588 KB
testcase_07 AC 250 ms
118,712 KB
testcase_08 AC 36 ms
52,572 KB
testcase_09 AC 184 ms
104,760 KB
testcase_10 AC 180 ms
104,756 KB
testcase_11 AC 34 ms
53,104 KB
testcase_12 AC 33 ms
53,700 KB
testcase_13 AC 303 ms
152,492 KB
testcase_14 AC 316 ms
152,484 KB
testcase_15 AC 300 ms
152,432 KB
testcase_16 AC 300 ms
152,828 KB
testcase_17 AC 311 ms
152,488 KB
testcase_18 AC 156 ms
114,568 KB
testcase_19 AC 303 ms
152,408 KB
testcase_20 AC 262 ms
136,716 KB
testcase_21 AC 257 ms
136,712 KB
testcase_22 AC 237 ms
138,248 KB
testcase_23 AC 93 ms
105,804 KB
testcase_24 AC 296 ms
149,604 KB
testcase_25 AC 310 ms
152,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))

cnt = [0 for _ in range(max(A) + 1)]
for i in range(n):
    cnt[A[i]] += 1

cnt_max = [0 for _ in range(n)]
for i in range(1, max(A) + 1):
    m = sum(cnt[i::i])
    if m != 0:
        cnt_max[n - m] = i
ans = 1
for i in range(n):
    ans = max(ans, cnt_max[i])
    print(ans)
0