結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー kenji_shioyakenji_shioya
提出日時 2017-01-07 14:52:10
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 568 bytes
コンパイル時間 3,848 ms
コンパイル使用メモリ 72,512 KB
実行使用メモリ 56,144 KB
最終ジャッジ日時 2023-08-22 16:14:38
合計ジャッジ時間 6,367 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,628 KB
testcase_01 AC 119 ms
55,708 KB
testcase_02 AC 120 ms
55,636 KB
testcase_03 AC 118 ms
56,088 KB
testcase_04 AC 119 ms
55,992 KB
testcase_05 AC 119 ms
55,760 KB
testcase_06 WA -
testcase_07 AC 118 ms
54,200 KB
testcase_08 WA -
testcase_09 AC 120 ms
55,664 KB
testcase_10 AC 118 ms
55,716 KB
testcase_11 AC 119 ms
55,812 KB
testcase_12 AC 118 ms
56,092 KB
testcase_13 AC 118 ms
55,452 KB
testcase_14 AC 120 ms
56,144 KB
testcase_15 AC 119 ms
55,992 KB
testcase_16 AC 118 ms
55,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.lang.NumberFormatException;

public class Rain {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    String[] array = new String[2];
    array[0] = sc.next();
    array[1] = sc.next();

    try {
      for (String x : array) {
        if (x.startsWith("0") && x.length() > 1) {
           throw new NumberFormatException();
        }
        Integer.parseInt(x);
      }
    } catch(NumberFormatException e) {
      System.out.println("NG");
      return;
    }
      System.out.println("OK");
  }
}
0