結果

問題 No.188 HAPPY DAY
ユーザー n.yn.y
提出日時 2022-05-27 13:38:29
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 21 ms / 1,000 ms
コード長 1,459 bytes
コンパイル時間 710 ms
コンパイル使用メモリ 106,340 KB
実行使用メモリ 23,592 KB
最終ジャッジ日時 2023-10-20 19:40:59
合計ジャッジ時間 1,129 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
23,592 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace yukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int ans30 = 0;
            int ans31 = 0;
            int ans28 = 0;
            int ans = 0;

            //月31日まで
            for(int i=0;i<=3;i++)
            {
                for (int j = 0; j <= 9; j++)
                {
                    ans = i + j;

                        if (ans == 1 || ans == 3 || ans == 5 || ans == 7 || ans == 8 || ans == 10)
                        {
                            ans31++;
                        
                        }
                    if (i == 3 && j < 1)
                    {
                        break;
                    }

                }
            }
            //月30日まで
            for(int i=0;i<=2;i++)
            {
                for(int j=0;j<=9;j++)
                {
                    ans = i + j;
                    if(ans==4||ans==6||ans==9||ans==11)
                    {
                        ans30++;
                    }
                }
            }
            //月28日まで
            for(int i=0;i<=2;i++)
            {
                for(int j=0;j<=8;j++)
                {
                    ans = i + j;
                    if(ans==2)
                    {
                        ans28++;
                    }
                }
            }

            Console.WriteLine(ans31+ans30+ans28);
        }
    }
}
0