题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1053

试图打表找规律,但无果...

看TJ了,暴搜;

注意参数 w 是 long long。

代码如下:

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
int n,ans,mx,pri[]={,,,,,,,,,};
void dfs(int ps,int cnt,int lst,ll w)//注意w是ll
{
if(cnt>mx)mx=cnt,ans=(int)w;
else if(cnt==mx)ans=min(ans,(int)w);
if(ps>)return;//
for(int i=;i<=lst&&w<=n;i++,w*=pri[ps])
dfs(ps+,cnt*(i+),i,w);
}
int main()
{
scanf("%d",&n);
dfs(,,,);
printf("%d\n",ans);
return ;
}

最新文章

  1. 基于Dubbo框架构建分布式服务(一)
  2. c语言自定义BOOL函数
  3. R语言数据处理利器——dplyr简介
  4. [DNX]解决dnu restore时找不到Newtonsoft.Json的问题
  5. dedecms首页调用的简介一直修改不了是自动文章摘要在作怪
  6. Java_类文件及加载机制
  7. python3_RoboBrowser_test
  8. Stream,Reader/Writer,Buffered的区别(1)
  9. 5个缺失的 JavaScript 数字格式化函数
  10. 49. Anagrams
  11. Samba出现“您可能没有权限使用网络资源”解决方法
  12. 【python】三个变量互换值
  13. C#中标准Dispose模式的实现
  14. Java中获得程序当前路径的4中方法
  15. drwtsn32.exe 遇到问题须要关闭。我们对此引起的不便表示抱歉
  16. json的js和C#操作
  17. 理解Java中的抽象
  18. Eclipse创建Maven项目报错的解决
  19. Kubernetes 在生产环境中常用架构
  20. 利用python实现电影推荐

热门文章

  1. CSS——规避脱标流和vertical-align
  2. 浅谈jQuery宽高及其应用
  3. Xftp 5 和 Xshell 5 基本使用方法
  4. 【转载】使用IntelliJ IDEA创建Maven聚合工程、创建resources文件夹、ssm框架整合、项目运行一体化
  5. golang实现高阶函数之map
  6. centos中安装tomcat
  7. 优雅的退出/关闭/重启gunicorn进程
  8. windows 实现vue命令行
  9. 【Codeforces 1106B】Lunar New Year and Food Ordering
  10. springCloud学习-服务消费者(Feign)