結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー tsunabittsunabit
提出日時 2019-06-09 17:57:11
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 861 bytes
コンパイル時間 3,796 ms
コンパイル使用メモリ 79,940 KB
実行使用メモリ 54,424 KB
最終ジャッジ日時 2024-04-15 20:09:15
合計ジャッジ時間 6,692 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
41,516 KB
testcase_01 AC 136 ms
41,684 KB
testcase_02 AC 133 ms
41,580 KB
testcase_03 WA -
testcase_04 AC 134 ms
41,336 KB
testcase_05 AC 135 ms
41,312 KB
testcase_06 AC 134 ms
41,300 KB
testcase_07 AC 135 ms
41,520 KB
testcase_08 AC 137 ms
41,732 KB
testcase_09 AC 138 ms
41,284 KB
testcase_10 AC 138 ms
41,432 KB
testcase_11 AC 134 ms
41,584 KB
testcase_12 WA -
testcase_13 AC 134 ms
41,564 KB
testcase_14 AC 135 ms
41,260 KB
testcase_15 AC 135 ms
41,444 KB
testcase_16 AC 136 ms
41,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class No446 {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);
        String a = sc.next(), b = sc.next();
        String atemp = a.replaceAll("\\D", "");
        String btemp = b.replaceAll("\\D", "");
        
        if(a.length() == atemp.length() && b.length() == btemp.length() && (a.length() > 1 && a.charAt(0) != '0') && (b.length() > 1 && b.charAt(0) != '0')) {
        	int ai = Integer.parseInt(atemp);
            int bi = Integer.parseInt(btemp);
        	if(ai <= 12345 && bi <= 12345) {
            	System.out.println("OK");
            }else {
            	System.out.println("NG");
            }
        }else {
        	System.out.println("NG");
        }
    }
}
0