結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー hogekihogeki
提出日時 2016-11-18 22:47:28
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 568 bytes
コンパイル時間 4,215 ms
コンパイル使用メモリ 103,876 KB
実行使用メモリ 22,804 KB
最終ジャッジ日時 2023-08-17 11:16:46
合計ジャッジ時間 5,167 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
22,724 KB
testcase_01 AC 53 ms
20,684 KB
testcase_02 AC 49 ms
20,472 KB
testcase_03 AC 53 ms
20,628 KB
testcase_04 AC 53 ms
20,740 KB
testcase_05 AC 49 ms
20,444 KB
testcase_06 AC 55 ms
22,668 KB
testcase_07 AC 48 ms
20,472 KB
testcase_08 AC 53 ms
20,692 KB
testcase_09 AC 49 ms
20,520 KB
testcase_10 AC 53 ms
20,724 KB
testcase_11 AC 49 ms
20,572 KB
testcase_12 AC 48 ms
20,496 KB
testcase_13 AC 53 ms
20,692 KB
testcase_14 AC 53 ms
20,616 KB
testcase_15 AC 54 ms
22,804 KB
testcase_16 AC 53 ms
20,736 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class Ame
{

	static public void Main(string[] args)
	{
		string A,B;
		A = Console.ReadLine();
		B = Console.ReadLine();
		if(isOK(A) && isOK(B))
			Console.WriteLine("OK");
		else
			Console.WriteLine("NG");
	}

	static bool isOK(string s)
	{

		for(int i=0; i<s.Length; i++)
		{
			if(i==0 && s[i] == '0')
			{
				if(s.Length == 1)
					return true;
				else
					return false;
			}
			if(s[i] >= '0' && s[i] <= '9')
				continue;
			return false;
		}

		int x = int.Parse(s);
		if(x >= 0 && x <= 12345)
			return true;
		else
			return false;
	}
}
0