HDUOJ A Mathematical Curiosity 1017
此题不难就是输出格式麻烦
#include<stdio.h>
int main(){
int T;
scanf("%d",&T);
while(T--)
{
int n,m,num=0;
while(scanf("%d %d",&n,&m)&&n!=0)
{
int a,b,sum=0;
for(a=1;a<100;++a)
for(b=a+1;b<n;++b)
{
if((a*a+b*b+m)%(a*b)==0) sum++;
}
printf("Case %d: %d\n",++num,sum);
}
if(T) printf("\n");
}
}
HDUOJ A Mathematical Curiosity 1017的更多相关文章
- 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 1017A Mathematical Curiosity (暴力统计特殊要求个数)
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1017 A Mathematical Curiosity Time Limit: 2000/1000 M ...
- A Mathematical Curiosity 分类: HDU 2015-06-25 21:27 11人阅读 评论(0) 收藏
A Mathematical Curiosity Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Ot ...
- A Mathematical Curiosity
A Mathematical Curiosity Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/O ...
- Hdu oj 1017 A Mathematical Curiosity
题目:pid=1017">点击打开链接 #include<stdio.h> int main() { int t; scanf("%d",&t) ...
- 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
题目简单,格式酸爽.. #include <iostream> using namespace std; int ans,n,m,p; int main() { cin>>p; ...
随机推荐
- AC日记——红色的幻想乡 洛谷 P3801
红色的幻想乡 思路: 线段树+容斥原理: 代码: #include <bits/stdc++.h> using namespace std; #define maxn 100005 #de ...
- sql 触发器 游标
在数据库中,删除一条记录的同时想要删除另一个表里的数据,这时我们可以选择使用触发器.触发器主要是通过事件进行触发被自动调用执行的,而存储过程可以通过存储过程的名称被调用.触发器是当对某一个表进行操作. ...
- python 重新执行循环中出错的那一次
# coding: utf-8 li = [1,2,3,4,5] for num in li: while True: try: # do something except some error: c ...
- pytho中pickle、json模块
pickle & json 模块 json,用于字符串 和 python数据类型间进行转换 pickle,用于python特有的类型 和 python的数据类型间进行转换 json模块提供了四 ...
- 《深入理解Android2》读书笔记(八)
接上篇<深入理解Android2>读书笔记(七) AMS中的进程管理 AMS对进程的管理仅涉及两个方面 1.调节进程的调度优先级和调度策略 2.调节进程的oom值 调度优先级和调度策略 1 ...
- python基础day4
1.列表生成式,迭代器&生成器 列表生成式 将列表[0,1,2,3,4,5,6,7,8]中的每个值加1,如何实现?常用的几种方法 方法一: a=[0,1,2,3,4,5,6,7,8] for ...
- HDU 5828 Rikka with Sequence(线段树 开根号)
Rikka with Sequence Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Othe ...
- apache配置httpd.conf相关
1.apache开启压缩AddOutputFilterByType 找到并打开apache/conf目录中的httpd.conf文件 在httpd.conf中打开deflate_Module,head ...
- Codeforces 551 D. GukiZ and Binary Operations
\(>Codeforces \space 551 D. GukiZ and Binary Operations<\) 题目大意 :给出 \(n, \ k\) 求有多少个长度为 \(n\) ...
- Clover 的功能就是给资源管理器加上 Chrome 一样的标签页
官网下载地址:http://cn.ejie.me/