結果

問題 No.2109 Special Week
ユーザー 👑 CleyL
提出日時 2022-12-21 00:21:15
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 543 bytes
コンパイル時間 563 ms
コンパイル使用メモリ 76,272 KB
最終ジャッジ日時 2025-02-09 17:38:51
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <set>

using namespace std;

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

int main(){
  int m,d,k;cin>>m>>d>>k;
  set<int> A;

  for(int i = 0; 7 > i; i++){
    if(m < 10){
      A.insert(0);
    }else{
      A.insert(1);
    }
    A.insert(m%10);

    if(d < 10){
      A.insert(0);
    }else{
      A.insert(d/10);
    }
    A.insert(d%10);

    d++;
    if(d > month[m-1]){
      m++;
      if(m==13)m=1;
      d=1;
    }
  }

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