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(淼)的更多相关文章

  1. HDOJ 1017 A Mathematical Curiosity

    Problem Description Given two integers n and m, count the number of pairs of integers (a,b) such tha ...

  2. HDU 1017 A Mathematical Curiosity【水,坑】

    A Mathematical Curiosity Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java ...

  3. HDU 1017 A Mathematical Curiosity (数学)

    A Mathematical Curiosity Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java ...

  4. HDU 1017 A Mathematical Curiosity【看懂题意+穷举法】

    //2014.10.17    01:19 //题意: //先输入一个数N,然后分块输入,每块输入每次2个数,n,m,直到n,m同一时候为零时  //结束,当a和b满足题目要求时那么这对a和b就是一组 ...

  5. Hdu oj 1017 A Mathematical Curiosity

    题目:pid=1017">点击打开链接 #include<stdio.h> int main() { int t; scanf("%d",&t) ...

  6. HDU 1017 - A Mathematical Curiosity

    题目简单,格式酸爽.. #include <iostream> using namespace std; int ans,n,m,p; int main() { cin>>p; ...

  7. HDU 1017 A Mathematical Curiosity(枚举)

    题目链接 Problem Description Given two integers n and m, count the number of pairs of integers (a,b) suc ...

  8. 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. ...

  9. HDU 1017 A Mathematical Curiosity (输出格式,穷举)

    #include<stdio.h> int main() { int N; int n,m; int a,b; int cas; scanf("%d",&N); ...

  10. HDU 1017 A Mathematical Curiosity (枚举水题)

    Problem Description Given two integers n and m, count the number of pairs of integers (a,b) such tha ...

随机推荐

  1. ./scripts/feeds update -a OpenWrt大招系列

    ./scripts/feeds update -a Updating feed 'packages' from 'https://github.com/openwrt/packages.git' .. ...

  2. 【转】linux 关机命令总结

    linux下常用的关机命令有:shutdown.halt.poweroff.init:重启命令有:reboot.下面本文就主要介绍一些常用的关机命令以及各种关机命令之间的区别和具体用法. 首先来看一下 ...

  3. Python3.5 queue模块详解

    queue介绍 queue是python中的标准库,俗称队列,可以直接import 引用,在python2.x中,模块名为Queue 在python中,多个线程之间的数据是共享的,多个线程进行数据交换 ...

  4. 基于RSA的加密/解密示例C#代码

    using System;using System.Security.Cryptography;using System.Text; class RSACSPSample{ static void M ...

  5. Rhythmbox乱码的解决的方法

    近期尝试 Listen 和 Banshee 才发现,Rhythmbox 上出现的 mp3乱码问题依然,并且更加严重,想要彻底弄清和解决必须搞清两点,第一, mp3 标签类型和编码,第二,各种播放器对 ...

  6. EEPlat vs saleforce 配置 Knowledge Article 演示样例

    ==================================================================================================== ...

  7. [HeadFist-HTMLCSS学习笔记][第七章CSS入门:加一点样式]

    CSS入门 style元素设置CSS 基本格式 <style type="text/css"> body { background-color: #eaf3da; } ...

  8. 一个很经典的this面试题

    !function(){ this.length = 10; var fn = function(){ console.log(this.length); //输出多少? }, arr = [fn, ...

  9. MongoDB学习笔记04

    创建索引使用ensureIndex方法,对于同一个集合,同样的索引只需要创建一次,反复创建是徒劳的. 对某个键的索引会加速对该键的查询,然而,对于其它查询可能没有帮助,即便是查询中包含了被索引的键.实 ...

  10. JS判断RadioButtonList是否有选中项

    提交表单之前对RadioButtonList控件的选中项进行判断: 方法一: <script type="text/javascript"> function chec ...