結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー nullzinenullzine
提出日時 2017-01-13 18:05:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 765 bytes
コンパイル時間 2,044 ms
コンパイル使用メモリ 71,580 KB
実行使用メモリ 57,368 KB
最終ジャッジ日時 2023-08-23 10:04:31
合計ジャッジ時間 5,117 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,960 KB
testcase_01 AC 126 ms
55,896 KB
testcase_02 AC 123 ms
56,280 KB
testcase_03 AC 121 ms
55,844 KB
testcase_04 AC 121 ms
55,928 KB
testcase_05 AC 123 ms
55,904 KB
testcase_06 AC 123 ms
55,808 KB
testcase_07 AC 122 ms
55,904 KB
testcase_08 AC 122 ms
55,880 KB
testcase_09 AC 122 ms
56,024 KB
testcase_10 AC 126 ms
55,676 KB
testcase_11 AC 123 ms
55,856 KB
testcase_12 AC 124 ms
55,596 KB
testcase_13 AC 123 ms
55,788 KB
testcase_14 AC 123 ms
55,740 KB
testcase_15 AC 124 ms
57,368 KB
testcase_16 AC 124 ms
56,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

/**
 * Created by nullzine on 2017/01/13.
 */
public class Main {

    public static void main(String[] args){
        System.out.println(new Main().run());
    }

    private String run(){
        Scanner sc = new Scanner(System.in);
        int aa,bb;
        String a,b;
        a = sc.nextLine();
        b = sc.nextLine();
        if(zeroValidation(a)||zeroValidation(b)){
            return "NG";
        }
        try{
            aa=Integer.parseInt(a);
            bb=Integer.parseInt(b);
        }catch(NumberFormatException e){
            return "NG";
        }
        return aa<=12345&&bb<=12345?"OK":"NG";
    }

    private boolean zeroValidation(String str){
        return !str.equals("0")&&str.charAt(0)=='0';
    }

}
0