結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー 37zigen37zigen
提出日時 2016-11-17 17:28:37
言語 Java19
(openjdk 21)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 907 bytes
コンパイル時間 4,554 ms
コンパイル使用メモリ 75,244 KB
実行使用メモリ 58,588 KB
最終ジャッジ日時 2023-08-17 08:03:20
合計ジャッジ時間 7,110 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 152 ms
56,232 KB
testcase_01 AC 142 ms
58,292 KB
testcase_02 AC 153 ms
58,068 KB
testcase_03 AC 154 ms
58,212 KB
testcase_04 AC 153 ms
56,128 KB
testcase_05 AC 151 ms
58,000 KB
testcase_06 AC 145 ms
55,948 KB
testcase_07 AC 152 ms
57,808 KB
testcase_08 AC 151 ms
58,588 KB
testcase_09 AC 156 ms
58,292 KB
testcase_10 AC 154 ms
57,992 KB
testcase_11 AC 149 ms
58,420 KB
testcase_12 AC 151 ms
56,096 KB
testcase_13 AC 142 ms
58,404 KB
testcase_14 AC 151 ms
55,872 KB
testcase_15 AC 145 ms
55,668 KB
testcase_16 AC 150 ms
57,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class Q446 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		boolean correct = true;
		for (int t = 0; t < 2; ++t) {
			String s = sc.next();
			{
				assert s.length() >= 1 && s.length() <= 5;
				for (int i = 0; i < s.length(); ++i) {
					boolean f = false;
					if (0 <= s.charAt(i) - 'a' && s.charAt(i) - 'a' <= 'z' - 'a') {
						f = true;
					}
					if (0 <= s.charAt(i) - 'A' && s.charAt(i) - 'A' <= 'Z' - 'A') {
						f = true;
					}
					if (0 <= s.charAt(i) - '0' && s.charAt(i) - '0' <= 9) {
						f = true;
					}
					assert f;
				}

			}
			boolean ok = false;
			for (int i = 0; i <= 12345; ++i) {
				if (String.valueOf(i).equals(s)) {
					ok = true;
				}
			}
			correct &= ok;
		}

		if (correct) {
			System.out.println("OK");
		} else {
			System.out.println("NG");
		}

		sc.close();

	}
}
0