結果
| 問題 |
No.2109 Special Week
|
| コンテスト | |
| ユーザー |
risujiroh
|
| 提出日時 | 2022-10-28 21:51:12 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 684 bytes |
| コンパイル時間 | 2,916 ms |
| コンパイル使用メモリ | 252,920 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-06 00:56:32 |
| 合計ジャッジ時間 | 3,881 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 35 WA * 2 |
ソースコード
#include <bits/stdc++.h>
void solve(std::istream& is, std::ostream& os) {
std::array const days = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int M, D, K;
is >> M >> D >> K;
std::stringstream ss;
for (int _ = 7; _--;) {
ss << std::setw(2) << std::setfill('0') << M;
ss << std::setw(2) << std::setfill('0') << D;
if (D == days[M]) {
if (M == 12) {
M = 1;
} else {
++M;
}
} else {
++D;
}
}
std::string s = ss.str();
os << (K <= int(std::set(s.begin(), s.end()).size()) ? "Yes\n" : "No\n");
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
solve(std::cin, std::cout);
}
risujiroh