結果

問題 No.2109 Special Week
ユーザー nyst
提出日時 2022-10-28 21:38:09
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 652 bytes
コンパイル時間 739 ms
コンパイル使用メモリ 94,700 KB
最終ジャッジ日時 2025-02-08 14:13:58
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 33 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <map>
using namespace std;
vector<int> days{0,31,28,31,30,31,30,31,31,30,31,30,31};
map<int,int> mp;

void digitcount(int t){
    mp[t%10]++;
    t/=10;
    mp[t%10]++;
}

int main(){
    int m,d,k;
    cin >> m >> d >> k;
    digitcount(m);
    digitcount(d);
    for(int i = 0;i<6;i++){
        d++;
        digitcount(d);
        if(days[m]==d) {
            d=1;
            digitcount(d);
            if(m==12) m = 1;
            else m++;
            digitcount(m);
        }
    }

    if(k<=mp.size()) cout << "Yes" << endl;
    else cout << "No" << endl;
}
0