結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー kmtrc130kmtrc130
提出日時 2019-03-18 16:58:15
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 54 ms / 2,000 ms
コード長 745 bytes
コンパイル時間 2,237 ms
コンパイル使用メモリ 104,768 KB
実行使用メモリ 22,888 KB
最終ジャッジ日時 2023-09-25 14:42:02
合計ジャッジ時間 4,038 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
20,792 KB
testcase_01 AC 53 ms
22,836 KB
testcase_02 AC 52 ms
20,696 KB
testcase_03 AC 53 ms
20,712 KB
testcase_04 AC 53 ms
20,740 KB
testcase_05 AC 53 ms
22,724 KB
testcase_06 AC 53 ms
20,740 KB
testcase_07 AC 54 ms
20,784 KB
testcase_08 AC 53 ms
18,696 KB
testcase_09 AC 53 ms
22,888 KB
testcase_10 AC 53 ms
22,716 KB
testcase_11 AC 53 ms
22,644 KB
testcase_12 AC 52 ms
20,708 KB
testcase_13 AC 53 ms
20,800 KB
testcase_14 AC 53 ms
20,820 KB
testcase_15 AC 53 ms
22,844 KB
testcase_16 AC 53 ms
18,836 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    public void Solve()
    {
        string[] AB = new string[2];
        AB[0] = Console.ReadLine();
        AB[1] = Console.ReadLine();

        bool isOK = false;
        int chkNumeric = 0;

        foreach (string chkString in AB)
        {
            isOK = false;

            if (!int.TryParse(chkString, out chkNumeric)) { break; }
            if (1 < chkString.Length && chkString.Substring(0, 1) == "0") { break; }
            if (12345 < chkNumeric) { break; }
            isOK = true;
        }
        Console.WriteLine(isOK ? "OK" : "NG");
    }

    static void Main()
    {
        var solver = new Program();
        solver.Solve();
    }
}
0