結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー yokoshabelyokoshabel
提出日時 2016-12-31 17:46:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 573 bytes
コンパイル時間 3,329 ms
コンパイル使用メモリ 72,036 KB
実行使用メモリ 56,284 KB
最終ジャッジ日時 2023-08-22 08:58:48
合計ジャッジ時間 6,358 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,256 KB
testcase_01 AC 120 ms
56,036 KB
testcase_02 AC 120 ms
55,948 KB
testcase_03 AC 118 ms
56,060 KB
testcase_04 AC 122 ms
55,816 KB
testcase_05 AC 118 ms
55,488 KB
testcase_06 AC 118 ms
55,984 KB
testcase_07 AC 123 ms
55,652 KB
testcase_08 AC 121 ms
56,060 KB
testcase_09 AC 122 ms
55,752 KB
testcase_10 AC 121 ms
56,028 KB
testcase_11 AC 122 ms
56,236 KB
testcase_12 AC 121 ms
55,484 KB
testcase_13 AC 122 ms
56,116 KB
testcase_14 AC 120 ms
56,284 KB
testcase_15 AC 122 ms
55,984 KB
testcase_16 AC 119 ms
55,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import static java.lang.System.out;
import java.util.Scanner;

public class No446{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String A=sc.nextLine();
		String B=sc.nextLine();
		int a=check(A);
		int b=check(B);
		if(a==1&&b==1){
			out.println("OK");
		}else{
			out.println("NG");
		}
	}
	private static int check(String s){
		if(s.length()<1&&s.length()>5){return 0;}
		if(s.length()>1&&s.indexOf("0")==0){return 0;}
		try{int n=Integer.parseInt(s);
			if(n<=12345){return 1;}
			else{return 0;}
		}catch(Exception e){return 0;}
	}
}
0