原题:http://codeforces.com/gym/100519/problem/D
Problem D
思路:
没营养,试两遍就行了
源代码:
#include <cstdio> #include <cstdlib> #include <cmath> int a,b=0; double c,tmp; int main() { scanf("%d%d",&a,&b); c=sqrt(b*b-a*a); tmp=c-round(c); if (tmp==0) { printf("YES\n"); exit(0); } c=sqrt(a*a+b*b); tmp=c-round(c); if (tmp==0) { printf("YES\n"); exit(0); } else { printf("NO\n"); exit(0); } return 0; }