【HDU 2092】整数解

http://acm.hdu.edu.cn/showproblem.php?pid=2092 


实现代码

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        a:
        while(s.hasNext()){
                    int v1 = s.nextInt();  
                    int v2 = s.nextInt();  
                    if (0 == (v1|v2)){
                        continue;
                    }
                    for(int i = -1000; i <= 1000; i++ ){
                        if(i * (v1-i) == v2){
                            System.out.println("Yes"); 
                            continue a;
                        }
                    }
                    System.out.println("No");
                }  
    }
}

性能


猜你喜欢

转载自blog.csdn.net/qq_31872713/article/details/80259365