結果
問題 | No.1730 GCD on Blackboard in yukicoder |
ユーザー |
|
提出日時 | 2021-11-05 21:36:00 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 483 ms / 2,000 ms |
コード長 | 308 bytes |
コンパイル時間 | 243 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 102,784 KB |
最終ジャッジ日時 | 2024-11-08 04:30:47 |
合計ジャッジ時間 | 10,370 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
n = int(input())M = 10**6+5L = [0]*Mfor a in map(int,input().split()):L[a] += 1ans = [1]*(n+1)for i in range(2,M)[::-1]:count = 0for j in range(i,M,i):count += L[j]ans[n-count] = max(ans[n-count],i)for i in range(n):print(ans[i])ans[i+1] = max(ans[i],ans[i+1])