Codeforces Beta Round #27-E. Number With The Given Amount Of Divisors
来源:互联网 发布:下载宇龙汽修仿真软件 编辑:程序博客网 时间:2024/06/01 09:49
原题链接
这道题的求解方法和求反素数相同
#include <bits/stdc++.h>#define INF 1e18using namespace std;typedef long long ll;int p[10] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29};ll ans = INF;int n;void dfs(int depth, ll temp, int num){if(num == n && ans > temp){ans = temp;return ;}for(int i = 1;; i++){ if(ans / p[depth] < temp|| (num*(i+1)) > n) break;dfs(depth+1, temp *= p[depth], num*(i+1));}}int main(){scanf("%d", &n);dfs(0, 1, 1);cout << ans << endl;return 0;}
0 0
- Codeforces Beta Round #27-E. Number With The Given Amount Of Divisors
- Codeforces Beta Round #27 E. Number With The Given Amount Of Divisors 含n个约数最小数
- 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 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(反素数)
- 2
- MemSQL性能测试结果
- 大概总结了一下jQuery的一些基础知识点
- 代码笔记 | ajax实现服务器与浏览器长连接的功能
- ajax跨域请求
- Codeforces Beta Round #27-E. Number With The Given Amount Of Divisors
- Vuejs——(4)v-if、v-for
- maven pom详解
- 有章法的学习c++(0)使用命令行编译文件
- easyUI吧复选框选中的value值返回
- 如何把UIView转成UIImage,解决模糊失真问题
- leetcode:sort:Maximum Gap(164)
- Joda-Time 简介
- 常用的JS小技巧------数组内不规则字符的排序