結果
問題 | No.188 HAPPY DAY |
ユーザー | AreTrash |
提出日時 | 2016-05-14 11:00:41 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 47 ms / 1,000 ms |
コード長 | 515 bytes |
コンパイル時間 | 3,801 ms |
コンパイル使用メモリ | 103,788 KB |
実行使用メモリ | 19,308 KB |
最終ジャッジ日時 | 2023-08-29 05:21:37 |
合計ジャッジ時間 | 3,115 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
コンパイルメッセージ
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); } } }