题目链接

/*
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(格式坑)的更多相关文章

  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 数学题

    解题报告:输入两个数,n和m,求两个数a和b满足0<a<b<n,并且(a^2+b^2+m) % (a*b) =0,这样的a和b一共有多少对.注意这里的b<n,并不可以等于n. ...

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

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

  9. 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. SMARTFORM 传值的4种方法

    *& 20161019 160300 smartform传值的方法 1.通过结构 传值: 最通常的用法是通过SE11中建立STRUCTURE XXX(表则没用),在REPORT中申明此结构的数 ...

  2. uwsgi+nginx项目上线

    一.基础环境配置 1.Linux安装配置     1.设置IP地址 [root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 ...

  3. 在运行myeclipse10注册机时,显示找不到com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel这个包

    在win7下安装MyEclipse10.安装完成之后运行注册机,总是提示classnotfond显示找不到com.sun.java.swing.plaf.nimbus.NimbusLookAndFee ...

  4. 合并apk和odex 为完整的apk安装文件

    from:http://bbs.hiapk.com/thread-1151284-1-1.html 文件夹:<ignore_js_op> 文件夹拖放到odex.cmd,出现下面的窗口后,按 ...

  5. Owncloud-X安装配置

    系统是基于Centos7.2 1.更改yum源: mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.back ...

  6. TOGAF和BABOK

  7. VM and Docker Container

    https://www.zhihu.com/question/48174633 在开始讨论前,先抛出一些问题,可先别急着查看答案,讨论的过程可以让答案更有趣,问题如下: Docker 容器有自己的ke ...

  8. 转:Windows下USB接口驱动技术(一)

  9. npm安装出错Unexpected end of input at 1:2307

    执行命令: npm cache clean --force 然后再安装 搞定

  10. Apache2.4整合tomcat8

    1,编译mod_jk.so 不同版本apache对应不同的mod_jk,试验用tomcat-connectors-1.2.41-src.tar.gz , 下载后,解压,进入./native文件夹依次输 ...