結果
| 問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-10-28 20:20:38 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 802 bytes |
| コンパイル時間 | 4,265 ms |
| コンパイル使用メモリ | 73,560 KB |
| 実行使用メモリ | 37,136 KB |
| 最終ジャッジ日時 | 2024-11-22 04:21:40 |
| 合計ジャッジ時間 | 4,720 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 11 WA * 2 |
ソースコード
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;
}
}