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 ...
随机推荐
- git 用户手册
Git是一个分布式版本控制/软件配置管理软件,原来是linux内核开发者林纳斯·托瓦兹为了更好地管理linux内核开发而创立的.需要注意的是和GNU Interactive Tools,一个类似Nor ...
- Entity Framework排序
public ActionResult Index() { using (ApplicationDbContext db = new ApplicationDbContext()) { //var l ...
- linux删除、移动、拷贝时,加-f仍然会提示的解决办法
cp -f 还是提示 root# alias 可以看到,执行cp就等于执行了cp -i,-i是确认提示 alias cp='cp -i' root# vi ~/.bashrc 修改完毕Esc, :wq ...
- tp其他功能
数据缓存 在ThinkPHP中进行缓存操作,一般情况下并不需要直接操作缓存类,因为系统内置对缓存操作进行了封装,3.1版本推荐的数据缓存方法是cache方法,基本的用法是:(3.1.2版本cache方 ...
- VS2003转VS2010 fatal error C1189: #error
我自己的mfc的demo要转换编译环境出现以下编译错误: VS2010编译错误:fatal error C1189: #error : This file requires _WIN32_WINNT ...
- java学习:AWT组件和事件处理的笔记(1)--菜单条,菜单,菜单项
菜单放在菜单条里,菜单项放在菜单里1.MenuBar 在java.awt包中,负责创建菜单条,即MenuBar的一个实例,便是一个菜单条. 在Frame类中的setMenuBar(Menu ...
- 正式学习React(四) 前序篇
预热 redux 函数内部包含了大量柯里化函数以及代码组合思想 柯里化函数(curry) 通俗的来讲,可以用一句话概括柯里化函数:返回函数的函数 // example const funcA = (a ...
- Oracle 修改密码 解锁
1.怎么修改oracle用户密码 在以SYSDBA身份登陆时可以修改其他用户的密码,比如: SQL> alter user 用户名 identified by 新密码; 用户已更改. 这个是把U ...
- Oracle EBS-SQL (PO-15):检查不能审批的PO.sql
SELECT PHA.SEGMENT1, PHA.WF_ITEM_KEY, PHA.* FROM PO.PO_HEADERS_ALL PHA WHERE PHA.AUTHORIZATION_STA ...
- SD卡在单片机上的应用
(1)SD卡的引脚定义: SD卡SPI模式下与单片机的连接图: 注意:SPI模式时,这些信号需要在主机端用10~100K欧的电阻上拉. SD卡支持两种总线方式:SD方式与SPI方式. ...