結果

問題 No.2109 Special Week
ユーザー kpinkcat
提出日時 2023-09-23 23:07:28
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,070 bytes
コンパイル時間 1,886 ms
コンパイル使用メモリ 195,672 KB
最終ジャッジ日時 2025-02-17 01:49:32
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 35 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
#include<string>
using ll = long long;
using namespace std;

int main()
{
    ll m, d, k, cnt = 0;
    cin >> m >> d >> k;
    vector<int> dd = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, v(10);
    for (int i = 0; i < 7; i++){
        int td = d + i;
        if (td > dd[m-1]){
            td -= dd[m-1];
            m++;
        }
        if (m == 13) m = 1;
        if (m < 10) {
            v[0]++;
            v[m]++;
        } else {
            v[1]++;
            v[m%10]++;
        }
        if (td < 10){
            v[0]++;
            v[td%10]++;
        } else if (td < 20){
            v[1]++;
            v[td%10]++;
        } else if (td < 30){
            v[2]++;
            v[td%10]++;
        } else {
            v[3]++;
            v[td%10]++;
        }
    }
    for (int i = 0; i < 10; i++){
        if (v[i]) cnt++;
    }
    cout << ((cnt >= k) ? "Yes" : "No") << endl; 
}
0