Codeforeces 27 E Number With The Given Amount Of Divisors(反素数)
来源:互联网 发布:linux 安装jdk gz 编辑:程序博客网 时间:2024/06/06 07:28
题目链接:
Codeforeces 27 E Number With The Given Amount Of Divisors
题意:
给出
#include <iostream>#include <cstdio>#include <cstring>#include <string>#include <algorithm>#include <climits>#include <cmath>#include <ctime>#include <cassert>#define IOS ios_base::sync_with_stdio(0); cin.tie(0);using namespace std;typedef long long ll;typedef unsigned long long lint;const lint inf = ~0ull;const int prime[]= {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53};int n;lint ans;void dfs(int depth, int limit, lint tmp, int num){ if(num > n) return; if(num == n && tmp < ans) ans = tmp; for(int i = 1; i <= limit; ++i) { //i相当于幂次 if(tmp * prime[depth] > ans) break; //不用扩展树的深度 tmp *= prime[depth]; if(n % (num * (i + 1)) == 0) { dfs(depth + 1, i, tmp, num * (i + 1)); } }}int main(){ while(cin >> n){ ans = inf; dfs(0, 63, 1, 1); cout << ans << endl; } return 0;}
0 0
- Codeforeces 27 E Number With The Given Amount Of Divisors(反素数)
- CodeForces - 27E Number With The Given Amount Of Divisors (反素数入门)
- [CodeForces 27E] Number With The Given Amount Of Divisors (数论 + 反素数)
- CodeForces 27E Number With The Given Amount Of Divisors【反素数】
- codeforces 27 E. Number With The Given Amount Of Divisors(反素数)
- CodeForce 27E: Number With The Given Amount Of Divisors(求反素数)
- codeforces 27E Number With The Given Amount Of Divisors(反素数)
- CF 27E Number With The Given Amount Of Divisors
- 27E - Number With The Given Amount Of Divisors
- Codeforces 27E - Number With The Given Amount Of Divisors
- Codeforces 27E Number With The Given Amount Of Divisors
- Codeforces 27 E Number With The Given Amount Of Divisors
- CodeForces 27E Number With The Given Amount Of Divisors
- codeforces 27E Number With The Given Amount Of Divisors
- zoj2562 More Divisors && CF27E. Number With The Given Amount Of Divisors(反素数)
- CF27E:Number With The Given Amount Of Divisors(反素数)
- CF27.E. Number With The Given Amount Of Divisors
- codeforces 27E E. Number With The Given Amount Of Divisors(dp+数论)
- C++ set容器迭代器
- 堆排序java实现
- 如何开启ubuntu的SSH服务
- iOS定位从 “始终”定位,改变成“使用期间”定位
- java命令行生成jar包
- Codeforeces 27 E Number With The Given Amount Of Divisors(反素数)
- cat <<EOF
- mac 配置openfile+ MySQL搭建即时聊天服务器
- "_iconv", referenced from: 的解决方法
- 达内学习第一阶段安卓学习,方便以后对比学习
- IOS应用开发,plist方式保存数据以及Preferences方式保存数据
- iOS开发学习路径的建议
- 不用额外空间,交换两个数
- HTTP之URL