結果

問題 No.2109 Special Week
ユーザー RustiebeatsRustiebeats
提出日時 2022-10-28 21:51:21
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,281 bytes
コンパイル時間 1,484 ms
コンパイル使用メモリ 167,876 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-06 00:56:46
合計ジャッジ時間 2,559 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _DEB312UG
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const long double pi = acos(-1.0);
const int INF = 1987654321;
const int MOD = 1e9;
// 

int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int cnt[12];

int main(){
#ifdef _DEBUG
    freopen ("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif  
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    
    int M, D, K; cin >> M >> D >> K;
    for(int i = 0; i < 7; i++){
        string aa = to_string(M);
        for(auto a : aa) cnt[a-'0']++;
        string bb = to_string(D);
        if(bb.length() == 1) cnt[0]++;
        for(auto b : bb) cnt[b-'0']++;
        
        // cout << aa << " " << bb << endl;
        
        D++;
        if(D > days[M-1]){
            if(M == 12){
                M = 1; 
                D = 1;
            }
            else{
                M = M+1;
                D = 1;
            }
        }
    }
    
    int ccntt = 0;
    for(int i = 0; i < 10; i++){
        if(cnt[i] >= 1) ccntt++;
    }
    // cout << ccntt << endl;
    if(ccntt >= K) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}   
0