結果

問題 No.2109 Special Week
ユーザー Maeda
提出日時 2025-04-15 09:14:19
言語 C#
(.NET 8.0.404)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 1,273 bytes
コンパイル時間 7,948 ms
コンパイル使用メモリ 169,504 KB
実行使用メモリ 190,252 KB
最終ジャッジ日時 2025-04-15 09:14:33
合計ジャッジ時間 12,151 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (104 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

    class Program
    {
        static void Main(string[] args)
        {
            int[] numList = new int[10];
            int[] n = Array.ConvertAll(Console.ReadLine().Split(' '), num => int.Parse(num.ToString()));
            DateTime checkDate = new DateTime(1, n[0], n[1]);
            for(int i = 0; i < 7; i++)
            {
                string dayStr = checkDate.ToString().Substring(5, 5);
                for(int j = 0; j < 5; j++)
                {
                    if (dayStr[j] == '/')
                    {
                        continue;
                    }
                    numList[int.Parse(dayStr[j].ToString())]++;
                }
                checkDate = checkDate.AddDays(1);
            }
            int count = PopNumber(numList);
            if(count >= n[2])
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }

        private static int PopNumber(int[] numList)
        {
            int count = 0;
            for(int i = 0; i < 10; i++)
            {
                if (numList[i] != 0)
                {
                    count++;
                }
            }
            return count;
        }
    }
0