結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー atkrymatkrym
提出日時 2016-12-28 10:44:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 803 bytes
コンパイル時間 2,699 ms
コンパイル使用メモリ 71,440 KB
実行使用メモリ 56,112 KB
最終ジャッジ日時 2023-08-21 17:58:43
合計ジャッジ時間 5,882 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,408 KB
testcase_01 AC 122 ms
55,744 KB
testcase_02 AC 124 ms
55,536 KB
testcase_03 AC 123 ms
55,852 KB
testcase_04 AC 123 ms
55,352 KB
testcase_05 AC 124 ms
55,832 KB
testcase_06 AC 124 ms
55,556 KB
testcase_07 AC 124 ms
56,016 KB
testcase_08 AC 123 ms
56,112 KB
testcase_09 AC 122 ms
55,712 KB
testcase_10 AC 122 ms
53,640 KB
testcase_11 AC 123 ms
55,592 KB
testcase_12 AC 123 ms
55,568 KB
testcase_13 AC 122 ms
55,704 KB
testcase_14 AC 121 ms
53,688 KB
testcase_15 AC 121 ms
55,684 KB
testcase_16 AC 120 ms
55,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.*;

public class Main {
    private static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        String a = sc.next();
        String b = sc.next();
        int ai = 0;
        int bi = 0;
        
        try {
            ai = Integer.parseInt(a);
            bi = Integer.parseInt(b);
        } catch (Exception e) {
            System.out.println("NG");
            return;
        }
        
        if ((a.length()!=1&&a.indexOf("0")==0)||(b.length()!=1&&b.indexOf("0")==0)) {
            System.out.println("NG");
            return;
        }
        
        if (ai>12345||bi>12345) {
            System.out.println("NG");
            return;
        }
        
        System.out.println("OK");
    }
}
0