結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
41,292 KB
testcase_01 AC 108 ms
40,192 KB
testcase_02 AC 107 ms
40,116 KB
testcase_03 WA -
testcase_04 AC 118 ms
41,276 KB
testcase_05 AC 103 ms
40,028 KB
testcase_06 AC 117 ms
41,080 KB
testcase_07 AC 121 ms
41,184 KB
testcase_08 AC 113 ms
40,936 KB
testcase_09 AC 115 ms
41,372 KB
testcase_10 AC 117 ms
41,020 KB
testcase_11 AC 120 ms
41,412 KB
testcase_12 WA -
testcase_13 AC 121 ms
41,456 KB
testcase_14 AC 101 ms
39,752 KB
testcase_15 AC 115 ms
41,276 KB
testcase_16 AC 123 ms
41,160 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.charAt(0) != '0' && 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