結果

問題 No.2109 Special Week
ユーザー eve__fuyuki
提出日時 2024-05-21 13:43:41
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 733 bytes
コンパイル時間 2,096 ms
コンパイル使用メモリ 199,920 KB
最終ジャッジ日時 2025-02-21 16:22:46
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

void fast_io() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
}

int main() {
    fast_io();
    int m, d, k;
    cin >> m >> d >> k;
    int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    string s = "";
    for (int i = 0; i < 7; i++) {
        s += to_string(m);
        s += to_string(d);
        if (m < 10) s += "0";
        if (d < 10) s += "0";
        d++;
        if (d > days[m]) {
            d = 1;
            m++;
            if (m > 12) m = 1;
        }
    }
    sort(s.begin(), s.end());
    s.erase(unique(s.begin(), s.end()), s.end());
    if (s.size() >= k) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }
}
0