题目:

pid=1017">点击打开链接

  1. #include<stdio.h>
  2. int main()
  3. {
  4. int t;
  5. scanf("%d",&t);
  6. while(t--)
  7. {
  8. int a=0;
  9. int m,n;
  10. while(scanf("%d%d",&n,&m))
  11. {
  12. if(m==0&&n==0)
  13. break;
  14. a++;
  15. int i,j,k,z=0;
  16. for(i=1;i<n;i++)
  17. for(j=i+1;j<n;j++)//(1 2) (2 1) 看作一种情况
  18. if((i*i+j*j+m)%(i*j)==0)
  19. {
  20. z++;
  21. }
  22. printf("Case %d: %d\n",a,z);
  23. }
  24. if(t)//略坑
  25. printf("\n");
  26. }
  27. return 0;
  28. }

Hdu oj 1017 A Mathematical Curiosity的更多相关文章

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

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

  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【看懂题意+穷举法】

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

  4. HDU 1017 - A Mathematical Curiosity

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

  5. HDU 1017 A Mathematical Curiosity(枚举)

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

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

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

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

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

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

  9. HDOJ 1017 A Mathematical Curiosity

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

随机推荐

  1. adb命令--之查看进程及Kill进程

    adb shell kill [PID]       //杀死进程 adb 命令查看程序进程方便简洁高效 adb shell ps       //查看所有进程列表,Process Status ad ...

  2. poj 2031--Building a Space Station(prim)

    Building a Space Station Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 6064   Accepte ...

  3. SQL注入原理解析以及举例1

    sql注入是指web应用程序对用户输入数据的合法性没有判断,导致攻击者可以构造不同的sql语句来实现对数据库的操作. sql注入漏洞产生满足条件: 1:用户能够控制数据的输入. 2:原本需要执行的代码 ...

  4. position记录元素原始位置

    position记录元素原始位置 css样式: li { width: 100px; height: 100px; margin: 10px 0 0 10px; background-color: # ...

  5. JavaScriptResult

  6. 「Redis 笔记」常用命令

    编号 命令 描述 1 DEL key 此命令删除一个指定键(如果存在). 2 DUMP key 此命令返回存储在指定键的值的序列化版本. 3 EXISTS key 此命令检查键是否存在. 4 EXPI ...

  7. Jmeter报内存溢出解决方案

    描述:wimdows环境,做上传图片接口测试,涉及图片合成和上传,图片采用base64编码.每1s启动200线程的时候,Jmeter报内存溢出错误. 解决方案: 1.修改jmeter.bat: set ...

  8. C# 重命名文件方法

    . //重命名文件 // 改名方法 FileInfo fi = new FileInfo("旧路径"); //xx/xx/aa.rar fi.MoveTo("新路径&qu ...

  9. git基础讲解

    idea :https://blog.csdn.net/autfish/article/details/52513465 eclipse:https://blog.csdn.net/yang57266 ...

  10. 【转】【Oracle 集群】Linux下Oracle RAC集群搭建之基本测试与使用(九)

    原文地址:http://www.cnblogs.com/baiboy/p/orc9.html   阅读目录 目录 检查RAC状态 检查创建的数据库 全部参考文献 相关文章 Oracle 11G RAC ...