結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー yokoshabel
提出日時 2016-12-31 17:46:32
言語 Java
(openjdk 23)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 573 bytes
コンパイル時間 3,156 ms
コンパイル使用メモリ 75,132 KB
実行使用メモリ 54,184 KB
最終ジャッジ日時 2024-12-16 04:35:09
合計ジャッジ時間 5,927 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

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