結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー YamaKasaYamaKasa
提出日時 2018-05-24 23:43:19
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 726 bytes
コンパイル時間 2,047 ms
コンパイル使用メモリ 71,616 KB
実行使用メモリ 56,304 KB
最終ジャッジ日時 2023-09-11 03:03:50
合計ジャッジ時間 5,132 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,688 KB
testcase_01 AC 123 ms
55,520 KB
testcase_02 AC 123 ms
55,936 KB
testcase_03 AC 122 ms
55,588 KB
testcase_04 AC 120 ms
56,304 KB
testcase_05 AC 119 ms
55,828 KB
testcase_06 AC 120 ms
55,708 KB
testcase_07 AC 121 ms
55,572 KB
testcase_08 AC 121 ms
55,596 KB
testcase_09 AC 123 ms
55,580 KB
testcase_10 AC 123 ms
55,552 KB
testcase_11 AC 122 ms
55,616 KB
testcase_12 AC 123 ms
55,560 KB
testcase_13 AC 121 ms
55,584 KB
testcase_14 AC 124 ms
55,688 KB
testcase_15 AC 122 ms
55,592 KB
testcase_16 AC 123 ms
55,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String A = scan.next();
		String B = scan.next();
		scan.close();
		if(isNumber(A) && isNumber(B)) {
			int a = Integer.parseInt(A);
			int b = Integer.parseInt(B);
			System.out.println("OK");
		}else {
			System.out.println("NG");
		}
	}
	public static boolean isNumber(String num) {
	    try {
	    	if(num.length() > 1 && num.substring(0, 1).equals("0")) {
	        	return false;
	    	}
	        int t = Integer.parseInt(num);
	        if(t > 12345) {
	        	return false;
	        }
	        return true;
	        } catch (NumberFormatException e) {
	        return false;
	    }
	}
}
0