E. Number With The Given Amount Of Divisors
time limit per test

2 seconds

memory limit per test

256 megabytes

input

standard input

output

standard output

Given the number n, find the smallest positive integer which has exactly n divisors. It is guaranteed that for the given n the answer will not exceed 1018.

Input

The first line of the input contains integer n (1 ≤ n ≤ 1000).

Output

Output the smallest positive integer with exactly n divisors.

Examples
Input
4
Output
6
Input
6
Output
12
思路:反素数;
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define esp 0.00000000001
#define pi 4*atan(1)
const int N=1e5+,M=2e7+,inf=1e9+,mod=1e9+;
const ll INF=1e18;
int p[N]={,,,,,,,,,,,,,,,};
ll x;
ll num;
void dfs(int pos,ll ans,ll sum,int pre)
{
if(sum>x)return;
if(sum==x)
num=min(ans,num);
for(int i=;i<=pre;i++)
{
if(INF/ans<p[pos])break;
dfs(pos+,ans*=p[pos],sum*(i+),i);
}
}
int main()
{
scanf("%lld",&x);
num=INF;
dfs(,,,);
printf("%lld\n",num);
return ;
}

Codeforces Beta Round #27 (Codeforces format, Div. 2) E. Number With The Given Amount Of Divisors 反素数的更多相关文章

  1. Codeforces Beta Round #27 (Codeforces format, Div. 2)

    Codeforces Beta Round #27 (Codeforces format, Div. 2) http://codeforces.com/contest/27 A #include< ...

  2. Codeforces Beta Round #27 E. Number With The Given Amount Of Divisors 含n个约数最小数

    http://codeforces.com/problemset/problem/27/E RT,求含n个约数的最小的数 我们设答案p = 2^t1 * 3^t2 * -- * p^tk(其中p是第k ...

  3. Codeforces Beta Round #32 (Div. 2, Codeforces format)

    Codeforces Beta Round #32 (Div. 2, Codeforces format) http://codeforces.com/contest/32 A #include< ...

  4. Codeforces Beta Round #31 (Div. 2, Codeforces format)

    Codeforces Beta Round #31 (Div. 2, Codeforces format) http://codeforces.com/contest/31 A #include< ...

  5. Codeforces Beta Round #29 (Div. 2, Codeforces format)

    Codeforces Beta Round #29 (Div. 2, Codeforces format) http://codeforces.com/contest/29 A #include< ...

  6. Codeforces Beta Round #80 (Div. 2 Only)【ABCD】

    Codeforces Beta Round #80 (Div. 2 Only) A Blackjack1 题意 一共52张扑克,A代表1或者11,2-10表示自己的数字,其他都表示10 现在你已经有一 ...

  7. Codeforces Beta Round #83 (Div. 1 Only)题解【ABCD】

    Codeforces Beta Round #83 (Div. 1 Only) A. Dorm Water Supply 题意 给你一个n点m边的图,保证每个点的入度和出度最多为1 如果这个点入度为0 ...

  8. Codeforces Beta Round #79 (Div. 2 Only)

    Codeforces Beta Round #79 (Div. 2 Only) http://codeforces.com/contest/102 A #include<bits/stdc++. ...

  9. Codeforces Beta Round #77 (Div. 2 Only)

    Codeforces Beta Round #77 (Div. 2 Only) http://codeforces.com/contest/96 A #include<bits/stdc++.h ...

随机推荐

  1. Cocos2d-x Lua中生命周期函数

    场景(Scene)以及所有节点(Node)的生命周期事件如下:enter.进入场景时候触发.enterTransitionFinish.进入场景而且过渡动画结束时候触发.exit.退出场景时候触发 . ...

  2. idea 不能编译生成class文件

    问题:开发工程中将idea中编译输出目录 out 删掉.发现再次编译不能生成class文件 解决方案:settings -> compiler 勾选自动编译选项

  3. 新提交审核app保留检查更新入口将被拒绝

    3月起要求关闭所有App内的检查更新功能,苹果App Store将向用户自动提示更新,新提交审核版本如果保留检查更新入口审核时将被拒绝,请各产品团队重点关注. 10.6 - Apple and our ...

  4. 动态加载和卸载 DLL

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  5. Mysql存储引擎的选择

    Mysql存储引擎概述 mysql的存储引擎是插件式的,用户可以根据需求选择如何存储和索引数据是否使用事务等. Mysql支持多种存储引擎,用户可以选择不同的引擎来提高应用的效率,灵活的存储方案,存储 ...

  6. win7安装laravel

    使用Packagist 镜像 建立一个composer.json文件,内容如下: { "name": "laravel/laravel", "desc ...

  7. mapper文件提示:No data sources are configured to run this sql

    mapper文件发出黄色警告. 输入数据库用户名和密码等等. 自动同步ok 就会发现代码变绿了,ok

  8. ubuntu常见错误--Could not get lock /var/lib/dpkg/lock解决(转)

    通过终端安装程序sudo apt-get install xxx时出错: E: Could not get lock /var/lib/dpkg/lock - open (11: Resource t ...

  9. 瑞丽熵(renyi entropy)

    在信息论中,Rényi熵是Hartley熵,Shannon熵,碰撞熵和最小熵的推广.熵能量化了系统的多样性,不确定性或随机性.Rényi熵以AlfrédRényi命名.在分形维数估计的背景下,Rény ...

  10. 根据URL请求 返回XML字符串

    public static string GetHttpResponse(string url) { string content = ""; // Create a new Ht ...