結果

問題 No.188 HAPPY DAY
ユーザー sanntarohsanntaroh
提出日時 2019-04-24 18:47:16
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 25 ms / 1,000 ms
コード長 779 bytes
コンパイル時間 1,013 ms
コンパイル使用メモリ 114,576 KB
実行使用メモリ 23,744 KB
最終ジャッジ日時 2024-04-26 03:59:55
合計ジャッジ時間 1,458 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
23,744 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.Linq;
using System.Collections.Generic;

namespace test20190423
{
    class Program
    {
        static void Main(string[] args)
        {
            DateTime baseDay = new DateTime(2015, 1, 1);
            Func<string, int, int, int> cal = (s, n1, n2) => int.Parse(s.Substring(n1, n2));
            List<string> ss = new List<string>();
            for (int i = 0; i < 365; i++)
            {
                var s = (baseDay + new TimeSpan(i, 0, 0, 0)).ToString();
                if (cal(s, 5, 2) == cal(s, 8, 1) + cal(s, 9, 1))
                {
                    ss.Add(s);
                    //Console.WriteLine(s);
                }

            }
            Console.WriteLine(ss.Count);
            //Console.ReadLine();
        }
    }
}
0