結果
問題 | No.2109 Special Week |
ユーザー |
![]() |
提出日時 | 2024-01-11 00:20:15 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 784 bytes |
コンパイル時間 | 2,465 ms |
コンパイル使用メモリ | 199,588 KB |
最終ジャッジ日時 | 2025-02-18 17:05:01 |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 37 |
ソースコード
#include <bits/stdc++.h>using namespace std;#ifdef LOCAL#include "settings/debug.cpp"#define _GLIBCXX_DEBUG#else#define Debug(...) void(0)#endif#define rep(i, n) for (int i = 0; i < (n); ++i)using ll = long long;using ull = unsigned long long;inline string format(int m, int d) {string s = "";if (m < 10) s += "0";s += to_string(m);if (d < 10) s += "0";s += to_string(d);return s;}int main() {int m, d, k;cin >> m >> d >> k;vector<int> mon = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };set<char> s;rep(_, 7) {for (char c : format(m, d)) s.insert(c);Debug(m, d, format(m, d), s);d++;if (d > mon[m]) d = 1, m++;if (m > 12) m = 1;}cout << (s.size() >= k ? "Yes" : "No") << endl;return 0;}