注意题目中的一句话: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;
}

  

HDU 4133的更多相关文章

  1. HDOJ 2111. Saving HDU 贪心 结构体排序

    Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

  2. 【HDU 3037】Saving Beans Lucas定理模板

    http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...

  3. hdu 4859 海岸线 Bestcoder Round 1

    http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...

  4. HDU 4569 Special equations(取模)

    Special equations Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u S ...

  5. HDU 4006The kth great number(K大数 +小顶堆)

    The kth great number Time Limit:1000MS     Memory Limit:65768KB     64bit IO Format:%I64d & %I64 ...

  6. HDU 1796How many integers can you find(容斥原理)

    How many integers can you find Time Limit:5000MS     Memory Limit:32768KB     64bit IO Format:%I64d ...

  7. hdu 4481 Time travel(高斯求期望)(转)

    (转)http://blog.csdn.net/u013081425/article/details/39240021 http://acm.hdu.edu.cn/showproblem.php?pi ...

  8. HDU 3791二叉搜索树解题(解题报告)

    1.题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=3791 2.参考解题 http://blog.csdn.net/u013447865/articl ...

  9. hdu 4329

    problem:http://acm.hdu.edu.cn/showproblem.php?pid=4329 题意:模拟  a.     p(r)=   R'/i   rel(r)=(1||0)  R ...

随机推荐

  1. luogu3386 【模板】 二分图匹配

    基本概念:二分图有两种节点:X节点和Y节点.如果X和Y可以匹配, 则X与Y连着一条边.每个X节点最多只能匹配一个Y节点,同时每个Y节点最多只能匹配一个X节点.最大匹配便是最多的匹配数. 交错路径:交错 ...

  2. Uva 11754(枚举+中国剩余定理)

    #include<iostream> #include<cstdio> #include<cmath> #include<cstring> #inclu ...

  3. [JavaEE] DWR入门教程

    DWR(Direct Web Remoting)是一个WEB远程调用框架.利用这个框架可以让AJAX开发变得很简单.利用DWR可以在客户端利用JavaScript直接调用服务端的Java方法并返回值给 ...

  4. kindoreditor上传图片

    <!doctype html><html> <head> <meta charset="utf-8" /> <title> ...

  5. V8 引擎是如何工作的?

    V8 引擎是如何工作的? 本文翻译自:How the V8 engine works? ​ V8是谷歌德国开发中心构建的一个JavaScript引擎.它是由C++编写的开源项目,同时被客户端(谷歌浏览 ...

  6. LVS十种调度算法介绍

    1.轮叫调度(Round Robin)(简称rr) 轮叫调度(Round Robin Scheduling)算法就是以轮叫的方式依次将请求调度不同的服务器,即每次调度执行i = (i + 1) mod ...

  7. Android ExpandableListView group的item有间距child间隔不变

    <ExpandableListView android:id="@+id/lv" android:layout_width="fill_parent" a ...

  8. Kotlin基础语法:变量、函数、类、枚举、控制流

    一切都需要从基础学起! 前言: 在Kotlin语言中,没有分号的概念了,也就是每一行代码,都不在需要用分号结束了 点击查看代码 定义 常量:val --相当于java当中的final 变量:var 关 ...

  9. 关于dlg和pro的问题

    微软链接:http://technet.microsoft.com/zh-cn/subscriptions/bb983387.aspx CDialogEx::CDialogEx 构造 CDialogE ...

  10. (转) RabbitMQ学习之spring整合发送异步消息

    http://blog.csdn.net/zhu_tianwei/article/details/40919031 实现使用Exchange类型为DirectExchange. routingkey的 ...