hdoj-1017-A Mathematical Curiosity(格式坑)
/*
Name:
Copyright:
Author:
Date: 2018/5/3 16:32:15
Description:
*/
#include <iostream>
#include <cstdio>
using namespace std;
int n, m;
bool equals(int a, int b) {
if ((a*a+b*b+m) % (a*b) == )return true;
return false;
}
int main()
{
int t;
cin>>t;
while (t--) {
int tag = ;
while (cin>>n>>m) {
if ((n+m) == ) break;
int ct = ;
for (int i=; i<n; i++) {
for (int j=i+; j<n; j++) {
if (i == j) continue;
if (equals(i, j)) {
ct++;
}
}
}
printf("Case %d: %d\n", ++tag, ct);
}
if (t >= ) printf("\n");//换行
}
return ;
}
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 数学题
解题报告:输入两个数,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 ...
随机推荐
- 我的第二个Python小程序
输出0-100之间的偶数: # Author: fansik # Description: Output an even number between 0 and 100 # method one n ...
- C# W3 调试
如果在调试附加进程中 没W3进程的话, 在运行里输入 uac 设置为从不通知 即可:
- 剑指offer 面试19题
面试19题: 题目:正则表达式匹配 题:请实现一个函数用来匹配包括'.'和'*'的正则表达式.模式中的字符'.'表示任意一个字符,而'*'表示它前面的字符可以出现任意次(包含0次). 在本题中,匹配是 ...
- Multi-thread & Multi-process
关于多进程和多线程,教科书上最经典的一句话是“进程是资源分配的最小单位,线程是CPU调度的最小单位”. 对于到底是使用多进程还是多线程, 要根据实际情况来判断,选择更适合的. 具体情况,可以参考下面: ...
- centos7+cobbler安装
cobbler工作流程 1.安装软件包: yum -y install httpd dhcp tftp python-ctypes cobbler xinetd cobbler-web pykicks ...
- 建议50:Python中的高级数据结构
# -*- coding:utf-8 -*- ''' Collection.Array.Heapq.Bisect.Weakref.Copy以及Pprint collections模块包含了内建类型之外 ...
- HTML table元素
搬运,内容来自HTML Dog. 简单示例 <!DOCTYPE html> <html> <body> <table> <tr> <t ...
- perl FAQ(zz)
1. Why do you write a program in Perl? Ans : Easy to use and fast execution since perl script underg ...
- 常用display属性
table 1. 宽高由内容撑开 2.独占一行 3.可设置宽高 4.可设置margin.padding inline-table 与display: table大体一致,区别在于不独占一行,为行内元素 ...
- Asp.net 5 (MVC6) Areas 分区
1. Startup.cs 类的 Configure方法中, 加入Area路由设置代码: //app.UseMvcWithDefaultRoute(); app.UseMvc(routes=> ...