結果

問題 No.1730 GCD on Blackboard in yukicoder
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2021-11-14 11:09:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 311 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 44,096 KB
最終ジャッジ日時 2024-05-06 23:35:40
合計ジャッジ時間 10,422 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 30 ms
10,752 KB
testcase_02 TLE -
testcase_03 TLE -
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 TLE -
testcase_08 AC 31 ms
10,880 KB
testcase_09 AC 1,751 ms
21,808 KB
testcase_10 AC 1,767 ms
22,168 KB
testcase_11 AC 32 ms
10,752 KB
testcase_12 AC 31 ms
10,880 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))
cnt = [0]*(max(A)+1)
for a in A:
    cnt[a] += 1
ans = [1]*(N+1)
mA = max(A)
for i in range(1,mA+1):
    tmp = 0
    for c in cnt[::i]:
        tmp += c
    ans[tmp] = max(i,ans[tmp])
    
tmp = 1
for i in range(N):
    tmp = max(tmp,ans[-1-i])
    print(tmp)
0