結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-21 09:58:20
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 659 bytes
コンパイル時間 2,078 ms
コンパイル使用メモリ 75,008 KB
実行使用メモリ 54,404 KB
最終ジャッジ日時 2024-04-10 07:15:27
合計ジャッジ時間 5,031 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
54,240 KB
testcase_01 AC 125 ms
54,088 KB
testcase_02 AC 123 ms
53,880 KB
testcase_03 AC 110 ms
53,036 KB
testcase_04 AC 111 ms
52,796 KB
testcase_05 AC 113 ms
52,720 KB
testcase_06 WA -
testcase_07 AC 122 ms
53,896 KB
testcase_08 WA -
testcase_09 AC 126 ms
53,988 KB
testcase_10 AC 128 ms
54,404 KB
testcase_11 AC 126 ms
54,032 KB
testcase_12 AC 127 ms
53,856 KB
testcase_13 AC 125 ms
54,252 KB
testcase_14 AC 130 ms
54,152 KB
testcase_15 AC 125 ms
54,112 KB
testcase_16 AC 124 ms
54,232 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 {
      for(int i = 0; i < a.length(); i++) {
        int d = Integer.parseInt(String.valueOf(a.charAt(i)));
      }
      for(int i = 0; i < b.length(); i++) {
        int d = Integer.parseInt(String.valueOf(b.charAt(i)));
      }
    } catch(NumberFormatException e) {
      ans = "NG";
    }
    System.out.println(ans);
  }
}
0