题目链接

/*
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. node.js, node-debug, node-inspector, npm 等等的使用问题解决

    1.node-debug的error: /home/hzh/hzh/soft/softy/node-v6.10.0-linux-x64/lib/node_modules/node-inspector/ ...

  2. docker快速构建oracle数据库

    1.查看可用镜像docker search oracle2.拉去想要的镜像docker pull wnameless/oracle-xe-11g3.基于wnameless/oracle-xe-11g创 ...

  3. when you are old

    When you are old william Butler Yeats When you are old and grey and full of sleep And nodding by the ...

  4. 设计模式之单例模式--instance

    <?php header('Content-Type:text/html;charest=utf-8'); /** * 设计模式之单例模式 * $_instance必须声明为静态的私有变量 * ...

  5. 010_Hadoop配置测试成功后关机重启浏览器打不开dfs和MP

    针对Hadoop成功配置并测试通过,第二次(关机重启)后Hadoop打不开的问题,一般都是因为防火墙的问题,将防火墙关闭后就可以了. 更细致的现象为start-all.sh启动,五大守护进程启动成功, ...

  6. hadoop06---多线程

    .1.1. 实现线程的两种方式 1.继承Thread的方式 见代码MyThreadWithExtends 2.声明实现 Runnable 接口的方式 见代码MyThreadWithImpliment ...

  7. linux下的cacti安装(centos7)

    1 cacti运行环境准备 cacti需要php+apache+mysql+snmp+RRDTool,以及cacti本身.cacti本体是用php开发的网站,通过snmp对远端设备信息进行采集.apa ...

  8. Java基础面试集合

    1.面向对象的特征有哪些方面? 抽象 封装 继承 多态,多态性是指允许不同子类型的对象对同一消息作出不同的响应.简单的说就是用同样的对象引用调用同样的方法但是做了不同的事情.多态性分为编译时的多态性和 ...

  9. K8s ipvs mode kube-proxy

    IPVS vs. IPTABLES IPVS模式在Kubernetes 1.8中被引入,在1.9中进入beta测试. IPTABLES模式在1.1版本中被添加进来,在1.2开始就变成了默认的操作模式. ...

  10. spark学习5(hbase集群搭建)

    第一步:Hbase安装 hadoop,zookeeper前面都安装好了 将hbase-1.1.3-bin.tar.gz上传到/usr/HBase目录下 [root@spark1 HBase]# chm ...