标签:
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 25460 Accepted Submission(s): 8911
1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <cmath> 5 6 using namespace std; 7 8 #define N 51 9 #define INF 0x3f3f3f3f 10 11 int main() 12 { 13 int n, m; 14 15 while(scanf("%d%d", &n, &m), n+m) 16 { 17 //int flag = 0; 18 19 double x = 1.0*(n+sqrt(n*n-4*m))/2; 20 double y = 1.0*(n-sqrt(n*n-4*m))/2; 21 22 if(x == (int) x && y == (int)y) 23 printf("Yes\n"); 24 else 25 printf("No\n"); 26 } 27 return 0; 28 }
认真学习,认真生活。好好思考,好好学习。
标签:
原文地址:http://www.cnblogs.com/Tinamei/p/4779974.html