HDOJ-1017 A Mathematical Curiosity(淼)
http://acm.hdu.edu.cn/showproblem.php?pid=1017
# include <stdio.h> int find(int n, int m)
{
int count = 0;
for(int i = 1; i < n; i++)
{
for(int j = i + 1; j < n; j++)
{
if(((i * i) + (j * j) + m) % (i * j) == 0)
count++;
}
}
return count;
} int main()
{
int t;
scanf("%d", &t);
while(t--)
{
int n, m, count = 1;
while(scanf("%d %d",&n, &m) && (n || m))
{
printf("Case %d: %d\n", count++, find(n, m));
}
if(t) printf("\n");
} return 0;
}
HDOJ-1017 A Mathematical Curiosity(淼)的更多相关文章
- HDOJ 1017 A Mathematical Curiosity
Problem Description Given two integers n and m, count the number of pairs of integers (a,b) such tha ...
- 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 oj 1017 A Mathematical Curiosity
题目:pid=1017">点击打开链接 #include<stdio.h> int main() { int t; scanf("%d",&t) ...
- 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 ...
随机推荐
- if switch练习(体重)
public class shencai { public static void main(String[] args) { int h= 186,g= 80; String Sex = " ...
- hdu 5656 CA Loves GCD(dp)
题目的意思就是: n个数,求n个数所有子集的最大公约数之和. 第一种方法: 枚举子集,求每一种子集的gcd之和,n=1000,复杂度O(2^n). 谁去用? 所以只能优化! 题目中有很重要的一句话! ...
- js实现a标签超链接提交form表单的方法
<a class="regButton" id="saveRegister" onclick="document.getElementBy ...
- 认识Ant
Ant是一个Apache基金会下的跨平台的构件工具,它可以实现项目的自动构建和部署等功能.在本文中,主要让读者熟悉怎样将Ant应用到Java项目中,让它简化构建和部署操作. 一. ...
- NYOJ130 同样的雪花 【Hash】
同样的雪花 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描写叙述 You may have heard that no two snowflakes are alike. ...
- [Javascript] How to write a Javascript libarary
Create package.json file //npm settings npm set init-author-name 'username' npm set init-author-emai ...
- struts2必需jar包
asm-3.3.jar commons-logging-1.1.3.jarasm-commons-3.3.jar freemarker-2.3. ...
- nginx配置文件(反向代理+集群+动静分离)
1.nginx纯反向代理配置(nginx.conf): #user nobody;worker_processes 4;error_log logs/error.log info;pid logs/n ...
- 软件测试作业三 尝试使用JUnit
写一个判断三角形种类的代码,对其进行测试. 判断三角形代码: package 测试1; public class sjx { public String f(int a,int b,int c) { ...
- uva 10935 throwing cards away <queue>
Given is an ordered deck of n cards numbered 1 to n with card 1 at the top and card n ...