結果
問題 | No.1730 GCD on Blackboard in yukicoder |
ユーザー |
![]() |
提出日時 | 2021-11-05 22:00:44 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 528 bytes |
コンパイル時間 | 379 ms |
コンパイル使用メモリ | 81,864 KB |
実行使用メモリ | 120,780 KB |
最終ジャッジ日時 | 2024-11-06 12:50:12 |
合計ジャッジ時間 | 7,136 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | TLE * 1 -- * 23 |
ソースコード
n = int(input())a = list(map(int,input().split()))from collections import defaultdictd = defaultdict(int)import math# ans = a[0]for i in range(n):l = set()# if i >= 1:# ans = math.gcd(ans,a[i])for j in range(1,int(a[i] ** (1/2)) + 1):if a[i] % j == 0:l.add(j)l.add(a[i]//j)for j in l:d[j] += 1d2 = defaultdict(int)for k in d.keys():d2[d[k]] = max(d2[d[k]],k)ans = 1for i in range(n):if (n-i) in d2:ans = d2[n-i]print(ans)