Hdu oj 1017 A Mathematical Curiosity
#include<stdio.h>
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int a=0;
int m,n;
while(scanf("%d%d",&n,&m))
{
if(m==0&&n==0)
break;
a++;
int i,j,k,z=0;
for(i=1;i<n;i++)
for(j=i+1;j<n;j++)//(1 2) (2 1) 看作一种情况
if((i*i+j*j+m)%(i*j)==0)
{
z++;
}
printf("Case %d: %d\n",a,z);
}
if(t)//略坑
printf("\n");
}
return 0;
}
Hdu oj 1017 A Mathematical Curiosity的更多相关文章
- HDU 1017 A Mathematical Curiosity【水,坑】
A Mathematical Curiosity Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java ...
- HDU 1017 A Mathematical Curiosity (数学)
A Mathematical Curiosity Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java ...
- HDU 1017 A Mathematical Curiosity【看懂题意+穷举法】
//2014.10.17 01:19 //题意: //先输入一个数N,然后分块输入,每块输入每次2个数,n,m,直到n,m同一时候为零时 //结束,当a和b满足题目要求时那么这对a和b就是一组 ...
- HDU 1017 - A Mathematical Curiosity
题目简单,格式酸爽.. #include <iostream> using namespace std; int ans,n,m,p; int main() { cin>>p; ...
- HDU 1017 A Mathematical Curiosity(枚举)
题目链接 Problem Description Given two integers n and m, count the number of pairs of integers (a,b) suc ...
- HDU 1017 A Mathematical Curiosity 数学题
解题报告:输入两个数,n和m,求两个数a和b满足0<a<b<n,并且(a^2+b^2+m) % (a*b) =0,这样的a和b一共有多少对.注意这里的b<n,并不可以等于n. ...
- HDU 1017 A Mathematical Curiosity (输出格式,穷举)
#include<stdio.h> int main() { int N; int n,m; int a,b; int cas; scanf("%d",&N); ...
- HDU 1017 A Mathematical Curiosity (枚举水题)
Problem Description Given two integers n and m, count the number of pairs of integers (a,b) such tha ...
- HDOJ 1017 A Mathematical Curiosity
Problem Description Given two integers n and m, count the number of pairs of integers (a,b) such tha ...
随机推荐
- JavaScript或者Jqurey把控件id作为參数来调用
1.JavaScript把控件id作为參数调用 <script type="text/javascript"> function xx(pmba) { document ...
- SQLServer2012 表IAM存储结构探究
SQLServer2012 表IAM存储结构探究 Author:zfive5(zidong) Email: zfive5@163.com 引子 国庆节期间,一直在翻阅<程序猿的自我修养-链接.装 ...
- B1237 [SCOI2008]配对 贪心 + dp
我刚开始,我打眼一看:哇!网络流大水题,直接费用流板子,建边跟zz一样.结果看了一眼数据范围...gg,luogu上只能得30,直接建边就是n^2,1e5根本过不了.咋办,只能另谋出路.想不出来,看题 ...
- C++ 指针 引用 变量引用
变量引用: 引用的作用就是给变量起个别名,假如有一个变量a,想给它起个别名b, 可以这么写:int a;//定义a是整型变量.int &b=a;//声明b是a的引用. 上面就是 ...
- js重定向
在现行的网站应用中URL重定向的应用有很多: 404页面处理.网址改变(t.sina转到weibo.com).多个网站地址(如:http://www.google.com/ .www.g.cn )等: ...
- MongoDB实现数组中重复数据删除
这个功能真的是写死我了,对于MongoDB一点都不熟悉,本来想使用spring与MongoDB的融合mongoDBTemplate,发现压根不是web项目,懒得配置那些配置文件,就使用最原始的数据库操 ...
- mac安装python3 pandas tushare
1,升级pip python3 -m pip install --upgrade pip 2,安装依赖包 pip install --user numpy scipy jupyter pandas s ...
- 12) 十分钟学会android--APP通信传递消息之简单数据传输
程序间可以互相通信是Android程序中最棒的功能之一.当一个功能已存在于其他app中,且并不是本程序的核心功能时,完全没有必要重新对其进行编写. 本章节会讲述一些通在不同程序之间通过使用Intent ...
- sql server<> != 从数据类型varchar转换为numeric 时出错
sql server 数据类型转换出错 字段percentcomplete 是 varchar 类型, 都是存的数字 用 where cast(percentcomplete as numeric(1 ...
- MongoDB经典入门(2)--shell命令
MongoDB是MongoDB自带的交互式Javascript shell,用来对MongoDB进行操作和管理的交互式环境. 使用 "./mongo --help" 可查看相关连接 ...