結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー shinwisteriashinwisteria
提出日時 2017-03-21 16:55:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 593 bytes
コンパイル時間 3,264 ms
コンパイル使用メモリ 72,680 KB
実行使用メモリ 58,036 KB
最終ジャッジ日時 2023-09-18 15:27:06
合計ジャッジ時間 6,463 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,120 KB
testcase_01 AC 123 ms
56,052 KB
testcase_02 AC 122 ms
56,112 KB
testcase_03 AC 123 ms
56,136 KB
testcase_04 AC 123 ms
55,632 KB
testcase_05 AC 123 ms
58,036 KB
testcase_06 AC 123 ms
56,096 KB
testcase_07 AC 124 ms
55,908 KB
testcase_08 AC 123 ms
56,112 KB
testcase_09 AC 124 ms
55,740 KB
testcase_10 AC 123 ms
55,696 KB
testcase_11 AC 123 ms
55,436 KB
testcase_12 AC 121 ms
56,072 KB
testcase_13 AC 125 ms
56,148 KB
testcase_14 AC 122 ms
56,320 KB
testcase_15 AC 124 ms
55,488 KB
testcase_16 AC 124 ms
55,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Ameyuki {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String A = s.nextLine();
		String B = s.nextLine();
		int a,b;
		s.close();
		
		try{
			a = Integer.parseInt(A);
			b = Integer.parseInt(B);
			if(a > 12345 || b > 12345||a < 0|| b < 0){
				a = Integer.parseInt("A");
			}else if(A.length() != Integer.toString(a).length() || B.length() != Integer.toString(b).length()){
				a = Integer.parseInt("A");
			}
			System.out.println("OK");
		}catch(NumberFormatException e){
			System.out.println("NG");
		}
	}

}
0