HDU-1017】的更多相关文章

C - 3 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1017 Description Given two integers n and m, count the number of pairs of integers (a,b) such that 0 < a < b < n and (a^2+b^2 +m)/(a…
A Mathematical Curiosity Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 41995    Accepted Submission(s): 13502 Problem Description Given two integers n and m, count the number of pairs of integ…
题目简单,格式酸爽.. #include <iostream> using namespace std; int ans,n,m,p; int main() { cin>>p; while(p--) { ; while(~scanf("%d%d",&n,&m)&&(n+m)) { ans=; ;i<n;i++) { ;j<n;j++) { ) ans++; } } printf("Case %d: %d\n&…
题目链接 Problem Description Given two integers n and m, count the number of pairs of integers (a,b) such that 0 < a < b < n and (a^2+b^2 +m)/(ab) is an integer. This problem contains multiple test cases! The first line of a multiple input is an inte…
题意是给定 n,m,问有多少组(a,b)满足 0 < a < b < n 而且 (a ^ 2 + b ^ 2 + m) / ( a * b ) 是整数. 直接模拟即可. 代码如下: #include <bits/stdc++.h> using namespace std; int main() { int t,ans,n,m; bool f = false; scanf("%d",&t); while(t--) { if(f) printf(&qu…
解题报告:输入两个数,n和m,求两个数a和b满足0<a<b<n,并且(a^2+b^2+m) % (a*b) =0,这样的a和b一共有多少对.注意这里的b<n,并不可以等于n. 简单的数学题,要注意的就是格式,这题TM描述的真烂,注意每组测试数据之后有一个空行,但最后一组测试数据之后没有空行. #include<cstdio> int main() { int T,n,m; scanf("%d",&T); while(T--) { ; whil…
A Mathematical Curiosity Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 25871    Accepted Submission(s): 8174 Problem Description Given two integers n and m, count the number of pairs of integ…
#include<stdio.h> int main() { int N; int n,m; int a,b; int cas; scanf("%d",&N); while(N--) { cas=1;//必须在这儿初始化cas,坑 while(scanf("%d%d",&n,&m),n||m) { int count=0; for(a = 1; a < n; a++)//穷举法 { for(b = a + 1; b <…
Problem Description Given two integers n and m, count the number of pairs of integers (a,b) such that 0 < a < b < n and (a^2+b^2 +m)/(ab) is an integer. This problem contains multiple test cases! The first line of a multiple input is an integer N…
//2014.10.17    01:19 //题意: //先输入一个数N,然后分块输入,每块输入每次2个数,n,m,直到n,m同一时候为零时  //结束,当a和b满足题目要求时那么这对a和b就是一组 //注意: //每一块的输出中间有一个回车 A Mathematical Curiosity Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s…