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 ...
随机推荐
- adb命令--之查看进程及Kill进程
adb shell kill [PID] //杀死进程 adb 命令查看程序进程方便简洁高效 adb shell ps //查看所有进程列表,Process Status ad ...
- poj 2031--Building a Space Station(prim)
Building a Space Station Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 6064 Accepte ...
- SQL注入原理解析以及举例1
sql注入是指web应用程序对用户输入数据的合法性没有判断,导致攻击者可以构造不同的sql语句来实现对数据库的操作. sql注入漏洞产生满足条件: 1:用户能够控制数据的输入. 2:原本需要执行的代码 ...
- position记录元素原始位置
position记录元素原始位置 css样式: li { width: 100px; height: 100px; margin: 10px 0 0 10px; background-color: # ...
- JavaScriptResult
- 「Redis 笔记」常用命令
编号 命令 描述 1 DEL key 此命令删除一个指定键(如果存在). 2 DUMP key 此命令返回存储在指定键的值的序列化版本. 3 EXISTS key 此命令检查键是否存在. 4 EXPI ...
- Jmeter报内存溢出解决方案
描述:wimdows环境,做上传图片接口测试,涉及图片合成和上传,图片采用base64编码.每1s启动200线程的时候,Jmeter报内存溢出错误. 解决方案: 1.修改jmeter.bat: set ...
- C# 重命名文件方法
. //重命名文件 // 改名方法 FileInfo fi = new FileInfo("旧路径"); //xx/xx/aa.rar fi.MoveTo("新路径&qu ...
- git基础讲解
idea :https://blog.csdn.net/autfish/article/details/52513465 eclipse:https://blog.csdn.net/yang57266 ...
- 【转】【Oracle 集群】Linux下Oracle RAC集群搭建之基本测试与使用(九)
原文地址:http://www.cnblogs.com/baiboy/p/orc9.html 阅读目录 目录 检查RAC状态 检查创建的数据库 全部参考文献 相关文章 Oracle 11G RAC ...