URAL-1748 The Most Complex Number
来源:互联网 发布:手机吉他软件模拟 编辑:程序博客网 时间:2024/05/21 09:00
http://blog.csdn.net/miaomiao_ymxl/article/details/52443371
My Mom传送门~~~~~十分十分的详细!!!
我就不做解释了,直接给代码好了(好迷啊(迷惑脸....))
[[[这里给出日常错误点吧~
Hans做此题wa了无数次,最后终于发现了错误!!!我!没写!lld!写的是!d!QuQ心好痛........
#include<cstdio>#include<cstdlib>#include<cstring>#include<iostream>#include<algorithm>using namespace std;long long n, ans, cnt;const int ss[16] = {1,2,3,5,7,11,13,17,19,23,29,31,37,41,43,47};void dfs(long long now_num, long long k_ss, long long now_cnt, int maxxcnt){if(k_ss >= 16) return;if(now_cnt > cnt || (now_cnt == cnt && now_num < ans)){ cnt = now_cnt; ans = now_num; } long long temp = ss[k_ss]; for(long long i = 1; i <= maxxcnt; i++){ if(temp > n / now_num) break; dfs(now_num*temp, k_ss+1, now_cnt*(i+1), i) ; temp *= ss[k_ss]; }}int main(){int t;scanf("%d", &t);while(t--){ scanf("%lld", &n); ans = cnt = 1LL; dfs(1, 1, 1, 50); printf("%lld %lld\n", ans, cnt);}return 0;}
0 0
- URAL-1748 The Most Complex Number
- URAL - 1748 The Most Complex Number(数论+搜索)
- Ural 1748. The Most Complex Number DFS+反素数
- URAL 1748. The Most Complex Number(反素数)
- URAL 1748 The Most Complex Number 深度优先搜索 反素数
- URAL 1748 The Most Complex Number 【区间最大反素数(模板)】
- 【 TIMUS-1748】【数学+搜索】The Most Complex Number【求反素数,数据范围较大】
- 反素数The Most Complex Number 搜索+剪枝
- 反素数应用 ZOJ 2562 More Divisors + Timus OJ 1748. The Most Complex Number
- timusoj 1748. The Most Complex Number (反素数&剪枝) 好题
- TIMUS-1748. The Most Complex Number-求反素数(数学+搜索)
- 1748. The Most Complex Number/LG的数学计划~~~持续更新ing(反素数求解)
- 反素数学习_The Most Complex Number
- The Most Frequent Number
- BIT1006 The most frequent number
- zoj 2132 The Most Frequent Number
- zoj 2132.The Most Frequent Number
- BIT 1006 The most frequent number
- ct升级到5.8,原来的项目出现问题
- 浅谈easyui的使用和实现机制
- apt-get update mirrors Err:2
- 关注
- java学习之java笔记(一)
- URAL-1748 The Most Complex Number
- Leetcode 1. Two Sum (Easy) (java)
- 15.2.2 字符串的提取和查询
- 我最常用的Elipse快捷键
- '<>' operator is not allowed for source level below 1.7
- 笛卡尔心形线
- 修改元素文本的默认选中样式
- Android带文字的ImageButton实现
- 15.2.1 字符串的连接