显示代码纯文本
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
ull prime[23]={0,2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,51,57,59,61,67,71,73};
ull ans=0xffffffffffffffff,n,M=1e18;
void dfs(int d,ull m,ull num,int t)
{
if(d>22) return;
if(m>M) return;
if(num>n) return;
if(m>ans) return;
if(n==num)
{
ans=min(ans,m);
return;
}
for(int i=1;i<=t;i++)
{
dfs(d+1,m*=prime[d],num*(i+1),i);
}
}
int main()
{
freopen("CF27E.in","r",stdin);
freopen("CF27E.out","w",stdout);
cin>>n;
dfs(1,1,1,64);
cout<<ans<<endl;
return 0;
}