結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-21 10:01:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 589 bytes
コンパイル時間 3,096 ms
コンパイル使用メモリ 75,484 KB
実行使用メモリ 54,512 KB
最終ジャッジ日時 2024-04-10 07:15:41
合計ジャッジ時間 4,691 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
53,008 KB
testcase_01 AC 114 ms
54,148 KB
testcase_02 AC 97 ms
52,440 KB
testcase_03 AC 111 ms
54,148 KB
testcase_04 AC 108 ms
54,212 KB
testcase_05 AC 115 ms
54,512 KB
testcase_06 AC 98 ms
52,772 KB
testcase_07 AC 114 ms
54,072 KB
testcase_08 AC 113 ms
54,160 KB
testcase_09 AC 114 ms
53,980 KB
testcase_10 AC 104 ms
53,220 KB
testcase_11 AC 114 ms
53,816 KB
testcase_12 AC 113 ms
54,032 KB
testcase_13 AC 112 ms
54,204 KB
testcase_14 AC 111 ms
53,908 KB
testcase_15 AC 115 ms
54,160 KB
testcase_16 AC 105 ms
52,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String a = sc.next();
    String b = sc.next();
    String ans = "OK";
    if((a.charAt(0) == '0') && (a.length() > 1)) ans = "NG";
    if((b.charAt(0) == '0') && (b.length() > 1)) ans = "NG";
    try {
      int A = Integer.parseInt(a);
      int B = Integer.parseInt(b);
      if((A < 0) || (A > 12345)) ans = "NG";
      if((B < 0) || (B > 12345)) ans = "NG";
    } catch(NumberFormatException e) {
      ans = "NG";
    }
    System.out.println(ans);
  }
}
0