結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-10-28 20:19:49
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 800 bytes
コンパイル時間 3,621 ms
コンパイル使用メモリ 73,432 KB
実行使用メモリ 37,060 KB
最終ジャッジ日時 2024-05-01 21:31:25
合計ジャッジ時間 5,379 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
36,892 KB
testcase_01 AC 54 ms
36,676 KB
testcase_02 AC 54 ms
36,736 KB
testcase_03 WA -
testcase_04 AC 54 ms
36,492 KB
testcase_05 AC 54 ms
37,060 KB
testcase_06 AC 54 ms
36,908 KB
testcase_07 AC 54 ms
36,896 KB
testcase_08 AC 53 ms
36,732 KB
testcase_09 WA -
testcase_10 AC 54 ms
36,720 KB
testcase_11 AC 53 ms
36,484 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 55 ms
36,716 KB
testcase_15 AC 54 ms
37,044 KB
testcase_16 AC 58 ms
36,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;

public class No446{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String a = br.readLine();
        String b = br.readLine();
        char[] A = a.toCharArray();
        char[] B = b.toCharArray();
        if(check(a, A) && check(b, B))  System.out.println("OK");
        else  System.out.println("NG");
    }
        
    
    public static boolean check(String a, char[] A){
        boolean c = false;
        int count = 0;
        for(int i=0; i < A.length; i++)
            if(Character.isDigit(A[i]))  count++;
        if(count == A.length){
           int num = Integer.parseInt(a);
           if(0 < num && num < 12345 ) c = true;
        }
        return c;
    }
}
0