杭电acm1017题 感觉代码没错,但就是ac不了,我无解了,题目是这样的: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
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/26 05:06:18
![杭电acm1017题 感觉代码没错,但就是ac不了,我无解了,题目是这样的: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](/uploads/image/z/14784328-64-8.jpg?t=%E6%9D%AD%E7%94%B5acm1017%E9%A2%98+%E6%84%9F%E8%A7%89%E4%BB%A3%E7%A0%81%E6%B2%A1%E9%94%99%2C%E4%BD%86%E5%B0%B1%E6%98%AFac%E4%B8%8D%E4%BA%86%2C%E6%88%91%E6%97%A0%E8%A7%A3%E4%BA%86%2C%E9%A2%98%E7%9B%AE%E6%98%AF%E8%BF%99%E6%A0%B7%E7%9A%84%EF%BC%9AGiven+two+integers+n+and+m%2Ccount+the+number+of+pairs+of+integers+%28a%2Cb%29+such+that+0+%3C+a+%3C+b+%3C+n+and+%28a%5E2%2Bb%5E2+%2Bm%29%2F%28ab%29+is+an+integer.This+problem+contains+multiple)
杭电acm1017题 感觉代码没错,但就是ac不了,我无解了,题目是这样的: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
杭电acm1017题 感觉代码没错,但就是ac不了,我无解了,
题目是这样的: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,then a blank line followed by N input blocks.Each input block is in the format indicated in the problem description.There is a blank line between input blocks.
The output format consists of N output blocks.There is a blank line between output blocks.
InputYou will be given a number of cases in the input.Each case is specified by a line containing the integers n and m.The end of input is indicated by a case in which n = m = 0.You may assume that 0 < n
杭电acm1017题 感觉代码没错,但就是ac不了,我无解了,题目是这样的: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
/*不知道你为什么觉得你的代码没有问题,连测试样例都没过.
题目中是第一行输入有几组测试数据,这个组不是case,而是每个0 0标志一组结束
下面是根据你代码修改AC后的结果,
*/
#include
int main()
{
\x05int n,m,i,j,x,a,z=0,c;
\x05scanf("%d",&x);
\x05for(a=1;a1) printf("\n");
\x05\x05c = 0;
\x05\x05while(++c)
\x05\x05{
\x05\x05\x05scanf("%d %d",&n,&m);
\x05\x05\x05if(!((n==m)&&(n==0)))
\x05\x05\x05{
\x05\x05\x05\x05z=0;
\x05\x05\x05\x05for(i=1;i