結果

問題 No.188 HAPPY DAY
ユーザー _yoshih__yoshih_
提出日時 2018-09-18 22:35:29
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 601 bytes
コンパイル時間 962 ms
コンパイル使用メモリ 63,444 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-25 09:56:24
合計ジャッジ時間 896 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

static void setup()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
}

static void run()
{
    static int kDays[] = {
        31, 28, 31, 30, 31, 30,
        31, 31, 30, 31, 30, 31,
    };

    auto n = 0;
    for (auto m = 1; m <= 11; ++m) {    // 12月は無理
        for (auto l = 0; l <= 3; ++l) {
            auto r = m - l;
            if (r >= 0 && r < 10 && (l * 10 + r <= kDays[m - 1])) {
                n += 1;
            }
        }
    }

    cout << n << endl;
}

int main(int argc, char **argv)
{
    setup();
    run();
    return 0;
}
0