結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー TonyMoooriTonyMooori
提出日時 2016-11-18 22:43:12
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 739 bytes
コンパイル時間 2,123 ms
コンパイル使用メモリ 102,860 KB
実行使用メモリ 22,796 KB
最終ジャッジ日時 2023-08-17 11:13:06
合計ジャッジ時間 3,590 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
20,668 KB
testcase_01 AC 51 ms
22,796 KB
testcase_02 AC 53 ms
20,728 KB
testcase_03 AC 51 ms
22,704 KB
testcase_04 AC 51 ms
22,652 KB
testcase_05 AC 50 ms
20,844 KB
testcase_06 AC 51 ms
22,780 KB
testcase_07 AC 50 ms
20,840 KB
testcase_08 AC 51 ms
22,728 KB
testcase_09 AC 50 ms
18,784 KB
testcase_10 AC 51 ms
20,684 KB
testcase_11 AC 50 ms
22,752 KB
testcase_12 AC 50 ms
20,612 KB
testcase_13 AC 50 ms
20,692 KB
testcase_14 AC 50 ms
20,680 KB
testcase_15 AC 50 ms
20,684 KB
testcase_16 AC 51 ms
20,728 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 Program
{
    static void Main()
    {
        var a_str = Console.ReadLine();
        var b_str = Console.ReadLine();
        Check(a_str);
        Check(b_str);
        End(true);
    }
    
    static void Check(string input)
    {
        int n;
        
        if( int.TryParse(input,out n) == false )
            End(false);
        if( input[0] == '0' && n != 0 )
            End(false);
        if( input.Length != 1 && n == 0 )
            End(false);
        if( n < 0 || 12345 < n )
            End(false);
    }
    
    static void End(bool flag)
    {
        if( flag )
            Console.WriteLine("OK");
        else
            Console.WriteLine("NG");
        
        Environment.Exit(0);
    }
}
0