結果
問題 | No.2109 Special Week |
ユーザー |
|
提出日時 | 2023-05-26 05:33:16 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,028 bytes |
コンパイル時間 | 2,437 ms |
コンパイル使用メモリ | 216,052 KB |
最終ジャッジ日時 | 2025-02-13 05:13:16 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 37 |
ソースコード
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef unsigned long long int ull; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); ll myRand(ll B) { return (ull)rng() % B; } inline double time() { return static_cast<long double>(chrono::duration_cast<chrono::nanoseconds>(chrono::steady_clock::now().time_since_epoch()).count()) * 1e-9; } int month[] = {31,28,31,30,31,30,31,31,30,31,30,31}; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); set<int> st; auto ins = [&](int m,int d) -> void { st.insert(m/10); st.insert(m%10); st.insert(d/10); st.insert(d%10); }; int m,d,k; cin >> m >> d >> k; for (int i = 0; i < 7; ++i) { ins(m,d); d++; if (month[m-1] < d) { d = 1; m++; if (m == 13) m = 1; } } if (st.size() >= k) { cout << "Yes" << endl; } else { cout << "No" << endl; } }