HDACM2092
由两个数的平方和肯定大于0然后就可以确定x,y所在的大概范围,最后即可找出x,y;
import java.util.Scanner;public class Main{public static void main(String[] args) {Scanner sc = new Scanner(System.in);while (sc.hasNext()) {int sum = sc.nextInt();int ride = sc.nextInt();if (sum==0&&ride==0) {break;}int x2_y2 = sum*sum-2*ride;boolean isYes = false;for (int i = -(int)Math.sqrt(x2_y2); i < (int)Math.sqrt(x2_y2); i++) {if ((sum-i)*i==ride) {isYes = true;break;}}if (isYes) {System.out.println("Yes");}else{System.out.println("No");}}}
}