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 ...
随机推荐
- WifiDog系统
WifiDog:A captive portal suite What is it composed of ? A: It is composed of 2 components: The clien ...
- memcached学习——memcached的内存分配机制Slab Allocation、内存使用机制LRU、常用监控记录(四)
内存分配机制Slab Allocation 本文参考博客:https://my.oschina.net/bieber/blog/505458 Memcached的内存分配是以slabs为单位的,会根据 ...
- python高级编程之描述符与属性02
# -*- coding: utf-8 -*- # python:2.x __author__ = 'Administrator' #元描述符 #特点是:使用宿主类的一个或者多个方法来执行一个任务,可 ...
- python学习之路-9 socket网络编程
socket基础 socket通常也称作"套接字",用于描述IP地址和端口,是一个通信链的句柄,应用程序通常通过"套接字"向网络发出请求或者应答网络请求. so ...
- RESTEasy 3.X Helloworld
最近呢,RESTEasy也升级了.升到了3.X. 官网:http://www.jboss.org/resteasy 集成使用也非常简单(相比SOAP而言) 第一步:下载jar包 resteasy是托管 ...
- Unity目录结构
http://www.cnblogs.com/liudq/p/5540051.htmlUnity中有几个默认目录 Unity5.x Resources 项目中默认的资源路径,会直接打包到游戏包中.即使 ...
- 制作可独立分发的Android模拟器
文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/6586759 如果我们编写了一个Android应 ...
- boost.asio系列——Timer
同步Timer asio中提供的timer名为deadline_timer,它提供了超时计时的功能.首先以一个最简单的同步Timer为例来演示如何使用它. #include<iostream&g ...
- oracle 10g 数据库字符集更改
1.更改数据库字符集为GBK SHUTDOWN IMMEDIATE; STARTUP MOUNT EXCLUSIVE; ALTER SYSTEM ENABLE RESTRICTED SESSION;A ...
- photoshop动作面板批量处理图片边框技巧
1,想给图片加上边框,在不改变图片大小的前提下,可以这样做:ctrl+a,全选图片,然后“编辑”-----“描边”,在跳出来的选项卡里面可以设置边框颜色,大小,位置,及混合模式, ,我们设置好了,就可 ...