注意题目中的一句话:If a number m has bigger evaluating value than all the numbers smaller than it。。。

这让我重新想过反素数的定义,应该 是比n小的数的约数的个数都  小于  n。所以,应该取最小的一个值

#include <iostream>
#include <cstdio>
#include <algorithm>
#define LL __int64
using namespace std;
LL n,ans,c; LL p[16]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53}; void solve(LL dep, LL tmp, LL num){
if(tmp>n) return ;
if(num>c||(num==c&&tmp<ans)){
ans=tmp;
c=num;
}
// cout<<tmp<<endl;
for(LL i=1;i<=60;i++){
if(tmp*p[dep]>n) break;
solve(dep+1,tmp*p[dep],num*(i+1));
tmp*=p[dep];
}
} int main(){
int t,kase=0;
scanf("%d",&t);
while(t--){
scanf("%I64d",&n);
ans=-1;
c=0;
solve(0,1,1);
printf("Case #%d: %I64d\n",++kase,ans);
}
return 0;
}

  

最新文章

  1. Redis使用及优化入门
  2. 【转】Android应用开发之PNG、IconFont、SVG图标资源优化详解
  3. wx菜单栏
  4. 我的Android开发相关文章
  5. HTML5 canvas中的路径方法
  6. Laravel资料
  7. LeetCode(32)-Binary Tree Level Order Traversal
  8. 学习 Spring (十七) Spring 对 AspectJ 的支持 (完结)
  9. 2019年1月6日 没有nainai吃 习题1
  10. ng4.0 使用[innerHTML]动态插入的富文本如何设置样式
  11. Python类方法、静态方法与实例方法 -----类里面不需要实例化参数 和没带self的函数 调用此函数的方法
  12. 微信小程序云开发之云函数创建
  13. STL——迭代器与traits编程技法
  14. HDU 2504 又见GCD (最大公因数+暴力)
  15. kaldi DNN在线解码 aishell为例
  16. Ubuntu打开core dump
  17. p2319 [HNOI2006]超级英雄
  18. c# 闲谈异常处理
  19. macOS中Vim基本配置,颜色主题/语法/indent设置
  20. phpmyadmin后台4种拿shell方法 &amp;&amp; php爆路径大法

热门文章

  1. cocos2d-x 是怎样渲染的
  2. GIS中mybatis_CMEU的配置方法
  3. The Unique MST--hdoj
  4. 【转】坑爹的AsyncTask之根本停不下来
  5. UVA-1335(UVALive-3177) Beijing Guards 贪心 二分
  6. js中的面向对象(一)封装
  7. Java登录界面简单设计
  8. WCF WEB HTTP请求 WCF REST FUL
  9. 5个对话框和FileStream:文件流
  10. Codeforces Round #451 &amp; Codeforces Round #452