結果
| 問題 |
No.2109 Special Week
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-28 22:21:07 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,057 bytes |
| コンパイル時間 | 1,956 ms |
| コンパイル使用メモリ | 200,752 KB |
| 最終ジャッジ日時 | 2025-02-08 14:39:47 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 WA * 2 |
ソースコード
#include <bits/stdc++.h>
#ifdef SHO_LOCAL
#include "debug.h"
#else
#define debug(...) \
{}
#endif
using namespace std;
pair<int, int> tomorrow(int m, int d) {
int lim = 31;
if (m == 2)
lim = 28;
if (m == 4 || m == 6 || m == 9 || m == 11)
lim = 30;
int nd = d++;
if (nd > lim) {
m++;
nd = 1;
}
if (m > 12) {
m = 1;
}
return make_pair(m, d);
}
int main() {
iostream::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int m, d, k;
cin >> m >> d >> k;
vector<pair<int,int>> days(1, {m, d});
for (int i = 0; i < 6; i++) {
days.push_back(tomorrow(days.back().first, days.back().second));
}
set<int> st;
for (int i = 0; i < 7; i++) {
auto [month, day] = days[i];
for (int j = 0; j < 2; j++) {
int cnt = 2;
while (cnt > 0) {
st.insert(month % 10);
month /= 10;
cnt--;
}
swap(month, day);
}
}
bool ok = (int)st.size() >= k;
cout << (ok ? "Yes" : "No") << '\n';
return 0;
}