A problem is easy
描述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 ?
- 输入
- The first line contain a T(T <= 2000) . followed by T lines ,each line contain an integer N (0<=N <= 10^11).
- 输出
- For each case, output the number of ways in one line
- 样例输入
-
2
1
3 - 样例输出
-
0
1import java.util.Scanner; public class Main {
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
int T;
int number;
int i;
int count; T=scanner.nextInt();
while(true){
if(T==0)
break;
T--; number=scanner.nextInt(); count=0;
number++;
for(i=2;i*i<=number;i++){
if(number%i==0)
count++;
}
System.out.println(count);
}
}
}
A problem is easy的更多相关文章
- ACM A problem is easy
A problem is easy 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 When Teddy was a child , he was always th ...
- [原]NYOJ-216-A problem is easy
大学生程序代写 /*A problem is easy 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 When Teddy was a child , he was a ...
- nyoj 216-A problem is easy ((i + 1) * (j + 1) = N + 1)
216-A problem is easy 内存限制:64MB 时间限制:1000ms 特判: No 通过数:13 提交数:60 难度:3 题目描述: When Teddy was a child , ...
- 1. A + B Problem【easy】
Write a function that add two numbers A and B. You should not use + or any arithmetic operators. Not ...
- UVA-11991 Easy Problem from Rujia Liu?
Problem E Easy Problem from Rujia Liu? Though Rujia Liu usually sets hard problems for contests (for ...
- [UVA] 11991 - Easy Problem from Rujia Liu? [STL应用]
11991 - Easy Problem from Rujia Liu? Time limit: 1.000 seconds Problem E Easy Problem from Rujia Liu ...
- codeforces A. In Search of an Easy Problem
A. In Search of an Easy Problem time limit per test 1 second memory limit per test 256 megabytes inp ...
- 2016弱校联盟十一专场10.5---As Easy As Possible(倍增)
题目链接 https://acm.bnu.edu.cn/v3/contest_show.php?cid=8506#problem/A problem description As we know, t ...
- Gym 100851E Easy Problemset (模拟题)
Problem E. Easy ProblemsetInput file: easy.in Output file: easy.outPerhaps one of the hardest problems ...
随机推荐
- 【MySQL】源码编译安装和配置MySql 5.5.32(单实例)
[需求描述] 在CentOS环境中,通过编译源码的方式,安装并且配置“单实例”的MySQL5.5.32数据库. MySQL的安装目录为:/application/mysql-5.5.32 MySQL数 ...
- how to javafx hide background header of a tableview?
http://stackoverflow.com/questions/12324464/how-to-javafx-hide-background-header-of-a-tableview ———— ...
- 如何防止ASP.NET网站遭受CSRF的攻击
转载地址: http://www.cnblogs.com/shanyou/p/5038794.html?hmsr=toutiao.io&utm_medium=toutiao.io&ut ...
- UI进阶 地图
一.地图的简介 在移动互联网时代,移动app能解决用户的很多生活琐事,比如 导航:去任意陌生的地方 周边:找餐馆.找酒店.找银行.找电影院 手机软件:微信摇一摇.QQ附近的人.微博. ...
- Apache服务器配置默认首页文件名和网站路径
默认首页的配置: 第一种:直接修改apache服务器的配置文件./conf/httpd.conf中的DirectoryIndex,如:(项目web以index.php为首页) <IfModule ...
- 导入flash 逐帧动画
只要图片是一序列的,比如0001-0100,就可以使用导入素材功能,选择第一张图片,选中影片剪辑并编辑然后点击导入到舞台,然后FlashCS6工具就会问你,这是一序列图片,是否逐帧导入,点是,就ok了 ...
- 【转】【Android测试技巧】01. root后adb shell默认不是root用户时,如何将文件放入手机系统中
http://blog.csdn.net/wirelessqa/article/details/8624208 有些机器root后通过adb shell 后,默认不是root用户,需要输入 su才能切 ...
- SCCM2007
Active Directory系统组发现:此方法按照上次运行发现方法时 Active Directory 中的响应返回对象,可发现活动目录OU.全局组.通用组.嵌套组.非安全组. Active Di ...
- jQuery循环滚动新闻列表
最近由于项目原因,学习了下jquery,实现了一个小小的功能,就是点击公告的上一条下一条来查看滚动条.具体代码如下: <!DOCTYPE html PUBLIC "-//W3C//DT ...
- Web开发者不可不知的15条编码原则
HTML已经走过了近20的发展历程.从HTML4到XHTML,再到最近十分火热的HTML5,它几乎见证了整个互联网的发展.但是,即便到现在,有很多基础的概念和原则依然需要开发者高度注意.下面,向大家介 ...