結果
| 問題 | No.188 HAPPY DAY | 
| コンテスト | |
| ユーザー |  AreTrash | 
| 提出日時 | 2016-05-14 11:00:41 | 
| 言語 | C#(csc) (csc 3.9.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 27 ms / 1,000 ms | 
| コード長 | 515 bytes | 
| コンパイル時間 | 4,962 ms | 
| コンパイル使用メモリ | 105,344 KB | 
| 実行使用メモリ | 18,304 KB | 
| 最終ジャッジ日時 | 2024-12-30 21:28:39 | 
| 合計ジャッジ時間 | 3,586 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 1 | 
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Linq;
namespace No188_1{
    public class Program{
        public static void Main(string[] args){
            const int year = 2015;
            var date = new DateTime(year, 1, 1);
            var happyDays = 0;
            for(var i = 0; i < 365 + (DateTime.IsLeapYear(year) ? 1 : 0); i++){
                var d = date.AddDays(i);
                if(d.Month == d.Day.ToString().Sum(c => c - '0')) happyDays++;
            }
            Console.WriteLine(happyDays);
        }
    }
}
            
            
            
        