水体一个,但是这种做题的方法值得发扬光大............

Just Do It

Time Limit: / MS (Java/Others)    Memory Limit: / K (Java/Others)
Total Submission(s): Accepted Submission(s): Problem Description
Now we define a function F(x), which means the factors of x. In particular, F() = ,since only has factor , F() = , since has factors , , . Now give you an integer k, please find out the minimum number x that makes F(x) = k. Input
The first line contains an integer t means the number of test cases.
The follows t lines, each line contains an integer k. ( < k <= ). Output
For each case, output the minimum number x in one line. If x is larger than , just output -. Sample Input Sample Output -

意思大概是,,,,,,9的因子都有1  3  9   三个数字  4也有三个因子    现在输入一个3  你需要输出   4(因为4 是有三个因子的数字中最小的数字)....意思就是这            很简单打表遍历,,,,但是  遍历的时候想到了,,,  如果倒序   遍历的话,例如  便利到9发现有3个因子,

这时候数组赋值为   a[3]=9;   然后一会有到4了,也是4个因子  在此进行赋值  a[3]=4;   这样的话,,简单又弱智

#include<stdio.h>
#include<string.h>
int main()
{
int q,i,j,m,n,t,a[],b,c;
memset(a,,sizeof(a));
for(i=;i>;i--)
{
q=;
for(j=i;j>;j--)
{
if(i%j==)
q++;
}
a[q]=i;
}
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
m=a[n];
if(m==)
m=-;
printf("%d\n",m);
}
return ;
}

hdu---------3189-------------------的更多相关文章

  1. hdu 3189(网络流+二分枚举)

    Steady Cow Assignment Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6422   Accepted: ...

  2. 【转载】图论 500题——主要为hdu/poj/zoj

    转自——http://blog.csdn.net/qwe20060514/article/details/8112550 =============================以下是最小生成树+并 ...

  3. hdu图论题目分类

    =============================以下是最小生成树+并查集====================================== [HDU] 1213 How Many ...

  4. HDU图论题单

    =============================以下是最小生成树+并查集====================================== [HDU] 1213 How Many ...

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

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

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

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

  7. hdu 4859 海岸线 Bestcoder Round 1

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

  8. HDU 4569 Special equations(取模)

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

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

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

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

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

随机推荐

  1. EXTJS中整合tinymce的富文本编辑器,添加上传图片功能

    提供部分代码.Ext.create('Ext.window.Window', { id: 'wind', title: 'CRUD窗口', modal: true, height: 800, widt ...

  2. Spring基于注解的配置概述

    以下内容引用自http://wiki.jikexueyuan.com/project/spring/annotation-based-configuration.html: 从Spring 2.5开始 ...

  3. httpclient请求去掉返回结果string中的多余转义字符

    public String doGet() { String uriAPI = "http://XXXXX?str=I+am+get+String"; String result= ...

  4. 数据库(Mysql)背后的数据结构-学习

    来吧,用这三篇文章夯实对Mysql的理解吧. 关于数据库索引及其优化,更多可参见此文:http://www.cnblogs.com/pkuoliver/archive/2011/08/17/mass- ...

  5. Windows7系统下优化固态硬盘

    一.AHCI硬盘模式可提高硬盘性能,确定你的固态硬盘是运行在AHCI模式下,打开“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servicesmsahci” ...

  6. HashMap、HashTable、TreeMap 深入分析及源代码解析

    在Java的集合中Map接口的实现实例中用的比較多的就是HashMap.今天我们一起来学学HashMap,顺便学学和他有关联的HashTable.TreeMap 在写文章的时候各种问题搞得我有点迷糊尤 ...

  7. webpack-Manifest

    Manifest 在使用 webpack 构建的典型应用程序或站点中,有三种主要的代码类型: 你或你的团队编写的源码. 你的源码会依赖的任何第三方的 library 或 "vendor&qu ...

  8. Lync 2013 与Exchange 2013 UM&amp;UC 集成!

     设置好对应的拨号计划.我们设置分机号码为4位: 配置好接入号码为5000: 配置自己主动助理号码为6000: 改动UM拨号模式为双模式: Set-UMService -identity Exch ...

  9. hdu 3853(数学期望入门)

    题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=3853 LOOPS Time Limit: 15000/5000 MS (Java/Others)    ...

  10. [数据集]新浪微博数据集MicroblogPCU

    数据集下载地址:下载 摘要:MicroblogPCU是从新浪微博採集到的.它能够被用于研究机器学习方法和社会关系研究. 这个数据集被原作者用于探索微博中的spammers(发送垃圾信息的人).他们的d ...