結果
問題 |
No.2109 Special Week
|
ユーザー |
![]() |
提出日時 | 2022-11-03 18:21:45 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 821 bytes |
コンパイル時間 | 894 ms |
コンパイル使用メモリ | 102,588 KB |
最終ジャッジ日時 | 2025-02-08 16:59:18 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 37 |
ソースコード
#include <iostream> #include <cstdio> #include <algorithm> #include <string> #include <vector> #include <queue> #include <set> #include <numeric> #include <cmath> #include <map> #define ll long long #define endl '\n' using namespace std; // category : int main() { ios_base::sync_with_stdio(false); int m,d,k; cin>>m>>d>>k; int lastDay[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; set<int> s; s.insert(m/10); s.insert(m%10); for(int i=0;i<7;i++){ int tm,td; if(d+i>lastDay[m]){ tm=m+1; td=d+i-lastDay[m]; } else { tm=m; td=d+i; } if(m!=tm) s.insert(tm/10), s.insert(tm%10); s.insert(td/10); s.insert(td%10); } s.size()>=k ? cout<<"Yes"<<endl : cout<<"No"<<endl; return 0; }