(i+1)*(j+1)=n+1

转换成上面这个式子,也就是问n+1的因子有几个

#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std; int main()
{
int T;
scanf("%d",&T);
while(T--)
{
long long n,y,i;
scanf("%lld",&n);
n++;
int anss=;
y=sqrt(1.0*n);
for(i=;i<=y;i++)
if(n%i==)
anss++;
printf("%d\n",anss);
}
return ;
}

HDU 2601 An easy problem的更多相关文章

  1. 数学--数论-- HDU 2601 An easy problem(约束和)

    Problem Description When Teddy was a child , he was always thinking about some simple math problems ...

  2. hdu 5475 An easy problem(暴力 || 线段树区间单点更新)

    http://acm.hdu.edu.cn/showproblem.php?pid=5475 An easy problem Time Limit: 8000/5000 MS (Java/Others ...

  3. HDU 5475 An easy problem 线段树

    An easy problem Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pi ...

  4. 数据结构(主席树):HDU 4729 An Easy Problem for Elfness

    An Easy Problem for Elfness Time Limit: 5000/2500 MS (Java/Others)    Memory Limit: 65535/65535 K (J ...

  5. HDU 2132 An easy problem

    http://acm.hdu.edu.cn/showproblem.php?pid=2132 Problem Description We once did a lot of recursional ...

  6. JHDU 2601 An easy problem (数学 )

    title: An easy problem 数学 杭电2601 tags: [数学] 题目链接 Problem Description When Teddy was a child , he was ...

  7. HDOJ(HDU) 2132 An easy problem

    Problem Description We once did a lot of recursional problem . I think some of them is easy for you ...

  8. hdu 2055 An easy problem (java)

    问题: 開始尝试用字符做数组元素.可是并没实用. 在推断语句时把a z排出了. An easy problem Time Limit: 1000/1000 MS (Java/Others)    Me ...

  9. HDU 2123 An easy problem

    http://acm.hdu.edu.cn/showproblem.php?pid=2123 Problem Description In this problem you need to make ...

随机推荐

  1. C++ std::stack

    std::stack template <class T, class Container = deque<T> > class stack; LIFO stack Stack ...

  2. 人机ai五子棋 ——五子棋AI算法之Java实现

    人机ai五子棋 下载:chess.jar (可直接运行) 源码:https://github.com/xcr1234/chess 其实机器博弈最重要的就是打分,分数也就是权重,把棋子下到分数大的地方, ...

  3. linux 开启防火墙操作

    1)在/etc/sysconfig/  下新建iptables文件,添加如下代码: *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ...

  4. CodeForces 645B Mischievous Mess Makers

    简单题. 第一次交换$1$和$n$,第二次交换$2$和$n-1$,第三次交换$3$和$n-2$.....计算一下就可以了. #pragma comment(linker, "/STACK:1 ...

  5. shell 读取文件

    #!/bin/bash content=`cat test.txt` echo "begin" for i in $content do echo $i done 读取前10行 t ...

  6. MySql开启远程访问(Linux)

    Linux服务器上安装了MySql数据库服务器之后,在远程访问出现了61错误.经检查后,发现需要在MySql配置文件中取消绑定IP.具体做法如下: 打开my.cnf配置文件.连接到服务器之后,在终端中 ...

  7. 问题记录1:The VMware Authorization Service is not running.

    问题 VMware Workstation cannot connect to the virtual machine. Make sure you have rights to run the pr ...

  8. Hadoop无法上传文件查找原因

    部署了集群,上传测试文件到HDFS文件系统的时候出现问题.could only be replicated to 0 nodes, instead of 1,如下图所示: 度娘寻找解决方案: 博客链接 ...

  9. ibaits的一个简单的完整的例子

    ibaits的简单介绍: iBatis 是apache 的一个开源项目,一个O/R Mapping(对象/关系映射) 解决方案,iBatis 最大的特点就是小巧,上手很快.如果不需要太多复杂的功能,i ...

  10. Knockout js 绑定 radio 时,当绑定整形的时候,绑定不生效

    解决方案: 使用checkedValue和checked 组合,如下代码. <div><input type="radio" name="flavorG ...