标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 32307 Accepted Submission(s): 10353
1 #include <iostream> 2 #include <stdio.h> 3 using namespace std; 4 5 int main() 6 { 7 int m, n, s, i, j, k, a, b, t; 8 scanf("%d",&s); 9 while(s--) 10 { 11 k=1; 12 while(~scanf("%d%d",&n,&m)) 13 { 14 t=0; 15 if(n==0&&m==0) 16 break; 17 for(a=1; a<n; a++) 18 for(b=1; b<a; b++) 19 if((a*a+b*b+m)%(a*b)==0) 20 t++; 21 printf("Case %d: %d\n",k,t); 22 k++; 23 } 24 if(s) printf("\n"); 25 } 26 27 return 0; 28 }
hdu 1017 A Mathematical Curiosity
标签:
原文地址:http://www.cnblogs.com/pshw/p/4780253.html