結果

問題 No.188 HAPPY DAY
ユーザー 紙ぺーぱー
提出日時 2015-04-18 00:47:29
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 30 ms / 1,000 ms
コード長 549 bytes
コンパイル時間 2,178 ms
コンパイル使用メモリ 106,496 KB
実行使用メモリ 18,688 KB
最終ジャッジ日時 2024-12-30 19:34:57
合計ジャッジ時間 2,091 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

static public class Program
{
    static public void Main()
    {
        readEOF();
        var cnt = 0;
        for (var d = new DateTime(2015,1,1); d.Year<=2015; d=d.AddDays(1))
        {
            if (d.Month == d.Day.ToString().Select(x => x - '0').Sum())
                cnt++;
        }
        Console.WriteLine(cnt);
    }
    static void readEOF()
    {
        if (Console.In.Peek() >= 0)
            throw new Exception("invalid input too long input file");
    }

}
0