結果

問題 No.188 HAPPY DAY
ユーザー cccccc
提出日時 2022-08-24 18:28:14
言語 C#
(.NET 8.0.203)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 2,127 bytes
コンパイル時間 9,497 ms
コンパイル使用メモリ 168,836 KB
実行使用メモリ 185,468 KB
最終ジャッジ日時 2024-04-20 07:44:00
合計ジャッジ時間 8,856 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (95 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;

namespace yukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
 	    string b="";
            int c = 0;
            int d = 0;
            int count = 0;
            for (int i=1;i<12;i++)
            {
                
                if (i==1||i==3||i==5||i==7||i==8||i==10||i==12)
                {
                    for (int j = 1; j <= 31; j++)
                    {
                        b = j.ToString();
                         c = int.Parse(b.Substring(0,1));
                        if (b.Length == 2)
                        {
                             d = int.Parse(b.Substring(1, 1));
                        }
                        if (i == c + d)
                        {
                            count++;
                        }
                        d = 0;
                    }
                }
                else if (i == 4||i==6||i==9||i==11)
                {
                    for (int j = 1; j <= 30; j++)
                    {
                        b = j.ToString();
                        c = int.Parse(b.Substring(0, 1));
                        if (b.Length == 2)
                        {
                            d = int.Parse(b.Substring(1, 1));
                        }
                        if (i == c + d)
                        {
                            count++;
                        }
                        d = 0;
                    }
                }
                else if (i==2)
                {
                    for (int j = 1; j <= 28; j++)
                    {
                        b = j.ToString();
                        c = int.Parse(b.Substring(0, 1));
                        if (b.Length == 2)
                        {
                            d = int.Parse(b.Substring(1, 1));
                        }
                        if (i == c + d)
                        {
                            count++;
                        }
                        d = 0;
                    }
                }
            }
            Console.WriteLine(count);
        }
    }
}
0