結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー rtomprtomp
提出日時 2016-11-22 20:00:11
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 1,916 bytes
コンパイル時間 867 ms
コンパイル使用メモリ 112,720 KB
実行使用メモリ 19,072 KB
最終ジャッジ日時 2024-05-05 12:22:10
合計ジャッジ時間 1,759 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
18,688 KB
testcase_01 AC 21 ms
19,072 KB
testcase_02 AC 21 ms
18,816 KB
testcase_03 AC 22 ms
18,688 KB
testcase_04 AC 23 ms
18,816 KB
testcase_05 AC 22 ms
18,688 KB
testcase_06 AC 21 ms
18,944 KB
testcase_07 AC 22 ms
18,560 KB
testcase_08 AC 23 ms
18,944 KB
testcase_09 AC 23 ms
18,688 KB
testcase_10 AC 23 ms
18,944 KB
testcase_11 AC 21 ms
18,944 KB
testcase_12 AC 22 ms
18,944 KB
testcase_13 AC 22 ms
18,944 KB
testcase_14 AC 22 ms
18,944 KB
testcase_15 AC 22 ms
18,944 KB
testcase_16 AC 21 ms
18,688 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.IO;
using System.Linq;

public class YukiCoder
{
    public static void Solve()
    {
        var A = MyConsole.String();
        var B = MyConsole.String();

        MyConsole.wLine( IsPass( A ) && IsPass( B ) ? "OK" : "NG" );
    }

    public static bool IsPass( string target )
    {
        if (target.Length != 1 && target[0] == '0') return false;

        int num;
        if (int.TryParse( target, out num ) == false) return false;

        return ( num <= 12345 );
    }

    public static void Main()
    {
        MyConsole.Read(); Solve(); MyConsole.Finish();
    }
}

public static class MyConsole
{
    private static List<string> ReadedLine = new List<string>();
    private static char[] buf = new char[1024];
    private static int i;

    public static void Read()
    {
        string sr = Console.In.ReadToEnd();

        ReadedLine = sr.Split( new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries ).ToList();

        Console.SetOut( new StreamWriter( Console.OpenStandardOutput() ) { AutoFlush = false } );
    }

    public static string String() { return ReadedLine[i++]; }
    public static string[] StringSplit() { return ReadedLine[i++].Split( new[] { ' ' } ); }

    public static int Int() { return int.Parse( ReadedLine[i++] ); }
    public static int[] IntSplit()
    {
        string[] strs = StringSplit();
        int[] ret = new int[strs.Length];
        for (int i = 0 ; i < strs.Length ; i++)
        {
            ret[i] = int.Parse( strs[i] );
        }

        return ret;
    }
    public static long Long() { return long.Parse( ReadedLine[i++] ); }
    public static double Double() { return double.Parse( ReadedLine[i++] ); }

    public static void wLine( string output = null )
    {
        Console.WriteLine( output );
    }

    public static void Finish()
    {
        Console.Out.Flush();
    }
}
0