南阳216 A problem is easy
来源:互联网 发布:windows版本发布年代 编辑:程序博客网 时间:2024/06/14 09:04
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
- 样例输入
213
- 样例输出
01
#include<stdio.h>int main(){ int n,i,t; scanf("%d",&t); while(t--) { int s=0; scanf("%d",&n); for(i=1;(i+1)*(i+1)<=n+1;i++) { if((n+1)%(i+1)==0) s++; } printf("%d\n",s); } return 0; } //吧i*j+i+j变形一下=(i+1)*(j+1)-1
0 0
- 南阳216 A problem is easy
- 南阳题目216-A problem is easy
- 南阳理工ACM 题目216 A problem is easy
- A problem is easy(南阳oj216)(数学变型)
- 216 A problem is easy
- A problem is easy
- A problem is easy
- A problem is easy
- A problem is easy
- A problem is easy
- A problem is easy
- A problem is easy
- A problem is easy
- nyoj 216 A problem is easy
- NYOJ-216-A problem is easy
- nyoj 216 A problem is easy
- nyoj-216-A problem is easy
- NYOJ 题目216 A problem is easy
- 再谈maven自动部署到tomcat的问题
- 关于C币的一点我的看法
- MyBatis学习总结(六)——调用存储过程
- MyBatis学习总结(七)——Mybatis缓存
- MyBatis学习总结(八)——Mybatis3.x与Spring4.x整合
- 南阳216 A problem is easy
- java枚举使用详解
- LRU算法
- Castle Windsor之组件注册
- 赛码1001 Movie(hdu 5214)
- Java 枚举7常见种用法
- java enum(枚举)使用详解 + 总结
- 得到windows系统图标的解决方案
- Java 反射之私有字段和方法详细介绍