(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. Oracle 列操作(增加列,修改列,删除列)

    1.增加一列: Alter table 表名 add 列名 varchar2(10); 2.修改一列: Alter table 表名 modify 列名 varchar2(20); 3.删除一列: A ...

  2. 斯坦福机器学习视频笔记 Week1 Linear Regression and Gradient Descent

    最近开始学习Coursera上的斯坦福机器学习视频,我是刚刚接触机器学习,对此比较感兴趣:准备将我的学习笔记写下来, 作为我每天学习的签到吧,也希望和各位朋友交流学习. 这一系列的博客,我会不定期的更 ...

  3. hdu1043

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

  4. Meterpreter

    监听 AutoRunScrip:自动执行脚本 如:自动执行post/windows/manage/migrate set AutoRunScript post/windows/manage/migra ...

  5. arm指令集

    http://blog.chinaunix.net/uid-20769502-id-112445.html

  6. C语言指针、地址、赋值三者含义

    先来一个观点.大家先看看对不对 按:在CSDN论坛上,有位坛友提到这个问题: ==================================== 先看一段代码: #include<stdi ...

  7. MySql 如何实现不同数据库同步【2个】

    环境要求: Windows 操作系统 需要Mysql 3.23.15以后的版本. 假设数据库A为主机,数据库B为从机(A向B提供同步服务,即B中的数据来自A) A机器:IP=10.10.151.166 ...

  8. Ajax中参数带有html格式的 传入后台保存【二】

    KindEditor.ready(function (K) { //编辑器插件 window.editor1 = K.create('#ctjs', { uploadJson: '/Hotelgl/U ...

  9. [河南省ACM省赛-第三届] BUYING FEED (nyoj 248)

    #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> us ...

  10. [转]8 Regular Expressions You Should Know

    Regular expressions are a language of their own. When you learn a new programming language, they're ...