結果
問題 | No.1730 GCD on Blackboard in yukicoder |
ユーザー |
![]() |
提出日時 | 2021-11-05 22:14:39 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 723 bytes |
コンパイル時間 | 356 ms |
コンパイル使用メモリ | 82,544 KB |
実行使用メモリ | 124,740 KB |
最終ジャッジ日時 | 2024-11-06 13:06:42 |
合計ジャッジ時間 | 18,273 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 TLE * 6 -- * 6 |
ソースコード
mod = 1000000007 eps = 10**-9 NN = 10 ** 6 def main(): import sys from collections import Counter input = sys.stdin.readline N = int(input()) A = list(map(int, input().split())) C = Counter(A) cnt = [N] * (NN+1) for a in C: x = C[a] for d in range(1, a+1): if d * d > a: break if a % d == 0: cnt[d] -= x if d * d != a: cnt[a // d] -= x ans = [1] * (N+1) for x in range(1, NN+1): k = cnt[x] ans[k] = x for i in range(1, N+1): ans[i] = max(ans[i], ans[i-1]) for i in range(N): print(ans[i]) if __name__ == '__main__': main()