Codeforces 27E - Number With The Given Amount Of Divisors
来源:互联网 发布:windows cmd 切换目录 编辑:程序博客网 时间:2024/06/05 14:33
深搜枚举即可。
#include <stdio.h>int a[100] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53};typedef unsigned long long ULL;int n;ULL ans;void dfs(int step, ULL tmp, int num){ if(num > n) return; if(num == n && tmp < ans) ans = tmp; for(int i = 1; i <= 64; i++) { if(ans / a[step] < tmp) break; dfs(step + 1, tmp * a[step], num * (i + 1)); tmp *= a[step]; }}int main(){ while(~scanf("%d", &n)) { ans = ~0ULL; dfs(0, 1, 1); printf("%I64u\n", ans); } return 0;}
0 0
- 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
- CF 27E Number With The Given Amount Of Divisors
- 27E - Number With The Given Amount Of Divisors
- codeforces 27E E. Number With The Given Amount Of Divisors(dp+数论)
- CodeForces - 27E Number With The Given Amount Of Divisors (反素数入门)
- [CodeForces 27E] Number With The Given Amount Of Divisors (数论 + 反素数)
- day4 CodeForces 27E Number With The Given Amount Of Divisors
- Codeforces Beta Round #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 (数论 dfs)
- CodeForces - 27E Number With The Given Amount Of Divisors (DFS+数学)
- codeforces 27 E. 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(dfs)
- NAT原理与NAT穿越
- 修改PHP的memory_limit限制的方法
- Arcgis ArcMap 10 如何生成msd地图文档定义【 arcgis mxd怎么转换成msd】
- 静态库.a和动态库.so
- Android 4.0 ICS SystemUI浅析——StatusBar结构分析
- Codeforces 27E - Number With The Given Amount Of Divisors
- java泛型的理解
- 黑马程序员-------基础UI学习之模型的使用
- Android截屏浅析
- 十大关系数据库SQL注入工具一览
- 解决安全问题 冲破云技术发展的瓶颈
- C语言动态规划(11)___免费馅饼
- 安卓handler消息处理机制
- 一眼回眸,醉了思念