HDU 1017 - A Mathematical Curiosity
题目简单,格式酸爽..
#include <iostream>
using namespace std;
int ans,n,m,p;
int main()
{
cin>>p;
while(p--)
{
int k=;
while(~scanf("%d%d",&n,&m)&&(n+m))
{
ans=;
for(int i=;i<n;i++)
{
for(int j=i+;j<n;j++)
{
if((i*i+j*j+m)%(i*j)==) ans++;
}
}
printf("Case %d: %d\n",k++,ans);
}
if(p) puts("");
}
}//2016-04-22 16:40:34
HDU 1017 - A Mathematical Curiosity的更多相关文章
- 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 1017 A Mathematical Curiosity(枚举)
题目链接 Problem Description Given two integers n and m, count the number of pairs of integers (a,b) suc ...
- 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 ...
- 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 ...
随机推荐
- 11i - 12 How To Set Email Style Preference For All Users At Once?
(文档 ID 578574.1) In this Document Goal Solution Workflow Information Center, Diagnostics, & ...
- list集合接口
import java.util.ArrayList; import java.util.List; class Phone { private String brand; private doubl ...
- [转]C++实现系统服务暂停、停止、启动
/* 名称:系统服务管理 语言:C++ 介绍:对Windows系统服务的状态获取,服务暂停,开启,停止操作代码 */ void CStartServiceDlg::OnBnClickedButton1 ...
- Seeding--zoj2100
Seeding Time Limit: 2 Seconds Memory Limit: 65536 KB It is spring time and farmers have to plan ...
- 一个Java项目的学习
1. java命令行的启动 首先是gradle build 其次是:java -Dabc.appid=1234 -classpath "a.jar:b.jar" com.ctri ...
- linux shell--算术运算
求和: 方法一.使用命令替换法: #!/bin/bash read -p 'input number a...' numA read -p 'input number b...' numB #这里有两 ...
- Esper
https://www.igvita.com/2011/05/27/streamsql-event-processing-with-esper/ http://torycatkin.iteye.com ...
- 从sample来学习Java堆(转)
1)Java堆 所有对象的实例分配都在Java堆上分配内存,堆大小由-Xmx和-Xms来调节,sample如下所示: public class HeapOOM { static class OOMOb ...
- CC++初学者编程教程(16) 搭建Xcode cocos2dx开发环境
1.下载cocos2dx,也可以从共享目录复制 2.解压缩 3.进入目录 cd Desktop/cocos2d-x-2.2.0/tools/project-creator/ 4.创建项目 ./crea ...
- tomcat root dir log 配置
tomcat 配置log记录及root 目录