結果

問題 No.337 P versus NP
ユーザー SagTokiSagToki
提出日時 2018-05-17 15:26:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 950 bytes
コンパイル時間 4,411 ms
コンパイル使用メモリ 71,792 KB
実行使用メモリ 55,940 KB
最終ジャッジ日時 2023-09-10 22:33:17
合計ジャッジ時間 7,869 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,584 KB
testcase_01 AC 127 ms
55,608 KB
testcase_02 AC 127 ms
55,824 KB
testcase_03 AC 125 ms
55,548 KB
testcase_04 AC 123 ms
55,472 KB
testcase_05 AC 126 ms
55,472 KB
testcase_06 AC 127 ms
55,524 KB
testcase_07 AC 124 ms
55,476 KB
testcase_08 AC 125 ms
55,696 KB
testcase_09 AC 125 ms
55,512 KB
testcase_10 AC 126 ms
55,792 KB
testcase_11 AC 124 ms
53,408 KB
testcase_12 AC 124 ms
55,572 KB
testcase_13 AC 126 ms
55,448 KB
testcase_14 AC 128 ms
55,940 KB
testcase_15 AC 125 ms
55,800 KB
testcase_16 AC 125 ms
55,316 KB
testcase_17 AC 128 ms
55,860 KB
testcase_18 AC 123 ms
55,864 KB
testcase_19 AC 123 ms
55,788 KB
testcase_20 AC 128 ms
55,832 KB
testcase_21 AC 131 ms
55,244 KB
testcase_22 AC 126 ms
55,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.InputMismatchException;

public class PversusNP {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        try{
        int N = scanner.nextInt();
        int P = scanner.nextInt();
        if(N < -50 || N > 50){
            System.out.println("Nの値は-50以上50以下の数字で入力してください");
            System.exit(0);
        }
        if(P < -50 || P > 50){
            System.out.println("Pの値は-50以上50以下の数字で入力してください");
            System.exit(0);
        }
        if(N * P == P){
            System.out.println("=");
        }else{
            System.out.println("!=");
        }
        }catch(InputMismatchException e){
            System.out.println("数字を入力してください");
        }catch(Exception E){
            System.out.println("予期せぬエラーです");
        }
    }
}
0