```
#include <bits/stdc++.h>
using namespace std;
int n;
int a;
long long inf;
int top;
int b[1000001];
inline int read()
{
int X=0,w=0; char ch=0;
while(!isdigit(ch)) {w|=ch=='-';ch=getchar();}
while(isdigit(ch)) X=(X<<3)+(X<<1)+(ch^48),ch=getchar();
return w?-X:X;
}
inline void write(int x)
{
if(x<0) putchar('-'),x=-x;
if(x>9) write(x/10);
putchar(x%10+'0');
}
int main()
{
n=read();
for(int i=1;i<=n;i++)
{
a = read();
double gen;
if(a > top) top = a;
gen = sqrt(a);
for(int j=1;j<=gen;j++)
{
if(a % j == 0)
{
b[j]++;
b[a/j]++;
}
if(gen - j <= 0.000001)
b[j]--;
}
}
for(int i=1;i<=n;i++)
{
for(int j=top;j>=1;j--)
{
if(b[j] >= i)
{
write(j);
puts("");
break;
}
}
}
return 0;
}
```
by BriMon @ 2018-02-11 19:01:40
%%%
by YoungNeal @ 2018-02-11 20:19:49
@[YoungNeal](/space/show?uid=56778) ( ̄. ̄)
by BriMon @ 2018-02-11 20:25:39
@[YoungNeal](/space/show?uid=56778) 别跑救我啊
by BriMon @ 2018-02-11 20:25:54
我不会这题,~~别逼我看题解~~
by YoungNeal @ 2018-02-11 20:27:36
@[YoungNeal](/space/show?uid=56778) 我不会hhhh,~~题解大法好~~
by BriMon @ 2018-02-11 20:29:47