結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
36,576 KB
testcase_01 AC 51 ms
36,924 KB
testcase_02 AC 52 ms
36,772 KB
testcase_03 AC 52 ms
36,952 KB
testcase_04 AC 52 ms
36,948 KB
testcase_05 AC 52 ms
36,520 KB
testcase_06 AC 52 ms
36,496 KB
testcase_07 WA -
testcase_08 AC 54 ms
36,856 KB
testcase_09 WA -
testcase_10 AC 53 ms
36,840 KB
testcase_11 AC 51 ms
36,520 KB
testcase_12 AC 51 ms
36,916 KB
testcase_13 AC 53 ms
36,880 KB
testcase_14 AC 54 ms
36,516 KB
testcase_15 AC 52 ms
36,560 KB
testcase_16 AC 52 ms
36,680 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