Problem Description

When Teddy was a child , he was always thinking about some simple math problems ,such as “What it’s 1 cup of water plus 1 pile of dough ..” , “100 yuan buy 100 pig” .etc..
One day Teddy met a old man in his dream , in that dream the man whose name was“RuLai” gave Teddy a problem : Given an N , can you calculate how many ways to write N as i * j + i + j (0 < i <= j) ? Teddy found the answer when N was less than 10…but if N get bigger , he found it was too difficult for him to solve.
Well , you clever ACMers ,could you help little Teddy to solve this problem and let him have a good dream ?

Input

The first line contain a T(T <= 2000) . followed by T lines ,each line contain an integer N (0<=N <= 1010).

Output

For each case, output the number of ways in one line.

Sample Input

2
1
3

Sample Output

0
1

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using namespace std; int main(){
int t;
long long n,i,j,ans;
scanf ("%d",&t);
while (t--){
ans=0;
scanf ("%lld",&n);
n++;
for (i=2;i*i<=n;i++){
if (n%i==0)
ans++;
}
printf ("%lld\n",ans);
}
return 0;
}

数学--数论-- HDU 2601 An easy problem(约束和)的更多相关文章

  1. HDU 2601 An easy problem

    (i+1)*(j+1)=n+1 转换成上面这个式子,也就是问n+1的因子有几个 #include<cstdio> #include<cstring> #include<c ...

  2. JHDU 2601 An easy problem (数学 )

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

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

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

  4. HDU 5475 An easy problem 线段树

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

  5. 数据结构(主席树):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 ...

  6. HDU 2132 An easy problem

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

  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 1792 A New Change Problem (GCD+打表找规律)

    Problem Description Now given two kinds of coins A and B,which satisfy that GCD(A,B)=1.Here you can ...

随机推荐

  1. 对EL自己以及对于param、header、cookie的相关应用的相关知识点的复习

    EL表达式语言是一种可以计算和输出的java对象的简单语言. 列入请求语句为下面的方式:request.setAttribute("username","zhangsan ...

  2. 登录窗口java

    这次代码是登录窗口的制作. 主要的方面是是包括,用户名.密码.验证码.以及输入数据所需要的文本框,对于验证码可以通过点击验证码进行修改.同时对于验证码的前景色和背景色同时都得到修改. 点击注册(这里还 ...

  3. Spring Cloud 系列之 Consul 注册中心(一)

    Netflix Eureka 2.X https://github.com/Netflix/eureka/wiki 官方宣告停止开发,但其实对国内的用户影响甚小,一方面国内大都使用的是 Eureka ...

  4. editplus 怎么替换为换行

    到editplus 的搜索 菜单中,选择替换,记住 这边如果是简单的一些 通用字符 替换可以直接替换,如果是一些特殊的字符 那必须选择 替换框左下中间的 “正则表达式”,即把这个“正则表达式” 前边的 ...

  5. 自己实现一个 DFA 串模式识别器

    自己实现一个 DFA 串模式识别器 前言 这是我编译原理课程的实验.希望读完这篇文章的人即便不知道 NFA,DFA 和正规表达式是什么,也能够对它们有一个简单的理解,并能自己去实现一个能够识别特定模式 ...

  6. PLSQL Developer 中文乱码踩坑记

    环境 操作系统版本: Windows 7 PL/SQL 版本: 12.0.1.1814 原因 由于 Oracle 服务器端和客户端字符集编码不一致引起的. 注意点 写在最前面,减少踩坑!!! 网上教程 ...

  7. 你只要5行代码,拥有你的个性二维码,用Python生成动态二维码

    如果想了解更多关于python的应用,可以私信我,或者点击下方链接自行获取,里面到资料都是免费的(http://t.cn/A6Zvjdun) 二维码满天飞,但是有没有想过Python也能制作出专属于自 ...

  8. D - Yet Another Monster Killing Problem

    题目连接: https://codeforces.com/contest/1257/problem/D 题目大意: n个怪兽,m个英雄,每个怪兽有一定的能力值,每个英雄有一定的能力值和一定的耐力值.耐 ...

  9. Jmeter实现multipart/form-data类型请求

    http请求有三种content-type:application/json.x-www-form-urlencoded.multipart/form-data,前两种比较常见,这里主要说multip ...

  10. Python爬取养眼图片

    1.准备 各位绅士们,你可能会觉得疫情在家无聊,那么现在我们的Python语言可以满足你们的需求.项目需要的工具(1)Python3(2)requests库requests库可以通过代码pip ins ...