結果
| 問題 |
No.1730 GCD on Blackboard in yukicoder
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-05 22:35:11 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 1,202 ms / 2,000 ms |
| コード長 | 393 bytes |
| コンパイル時間 | 293 ms |
| コンパイル使用メモリ | 82,492 KB |
| 実行使用メモリ | 120,744 KB |
| 最終ジャッジ日時 | 2024-11-08 04:48:58 |
| 合計ジャッジ時間 | 14,708 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 |
ソースコード
import sys
input = sys.stdin.readline
from collections import *
N = int(input())
A = list(map(int, input().split()))
acnt = Counter(A)
M = max(A)
cnt = [0]*(M+1)
for i in range(1, M+1):
for j in range(i, M+1, i):
cnt[i] += acnt[j]
d = defaultdict(int)
for i in range(M+1):
d[cnt[i]] = max(d[cnt[i]], i)
ans = 1
for K in range(N):
ans = max(ans, d[N-K])
print(ans)