結果
問題 | No.1730 GCD on Blackboard in yukicoder |
ユーザー |
![]() |
提出日時 | 2021-11-06 00:20:15 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 992 ms / 2,000 ms |
コード長 | 325 bytes |
コンパイル時間 | 342 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 114,560 KB |
最終ジャッジ日時 | 2024-11-08 04:56:10 |
合計ジャッジ時間 | 12,098 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
n = int(input()) A = list(map(int, input().split())) from collections import Counter C = Counter(A) M = max(A) X = [0]*n for g in range(1, M+1): j = g cnt = 0 while j <= M: cnt += C[j] j += g if cnt != 0: X[n-cnt] = g ans = 1 for i in range(n): ans = max(ans, X[i]) print(ans)