結果

問題 No.779 Heisei
ユーザー Crowea
提出日時 2019-01-19 13:24:37
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 27 ms / 1,000 ms
コード長 1,073 bytes
コンパイル時間 2,679 ms
コンパイル使用メモリ 112,908 KB
実行使用メモリ 28,060 KB
最終ジャッジ日時 2024-11-06 02:36:18
合計ジャッジ時間 4,118 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace yukicoder
{
    class Program
    {
        /// <summary>
        /// 平成の最小値
        /// </summary>
        private static readonly DateTime MIN_HEISEI = new DateTime(1989, 1, 8);
        /// <summary>
        /// 平成の最大値
        /// </summary>
        private static readonly DateTime MAX_HEISEI = new DateTime(2019, 4, 30);

        /// <summary>
        /// 日付を比較
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        static string CompareToDate(DateTime dt)
        {
            return (MIN_HEISEI <= dt && dt <= MAX_HEISEI) ? "Yes" : "No";
        }

        static void Main(string[] args)
        {
            // 入力値(日付)読み込み
            var inputDate = Console.ReadLine().Split(' ');
            int yyyy = int.Parse(inputDate[0]);
            int mm = int.Parse(inputDate[1]);
            int dd = int.Parse(inputDate[2]);
            var dt = new DateTime(yyyy, mm, dd);
            Console.WriteLine(CompareToDate(dt));
        }
    }
}
0