結果
問題 |
No.2109 Special Week
|
ユーザー |
|
提出日時 | 2024-03-20 09:23:14 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 657 bytes |
コンパイル時間 | 4,378 ms |
コンパイル使用メモリ | 251,408 KB |
最終ジャッジ日時 | 2025-02-20 08:00:20 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 37 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using ll = long long; int M, D, K; int days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int cnt[10]; int main() { cin >> M >> D >> K; int m, d; for (int i = 0; i < 7; i++) { m = M, d = D + i; if (days[M - 1] < d) { m = (m + 1) % 12; d = d - days[M - 1]; } char mmdd[5]; sprintf(mmdd, "%02d%02d", m, d); for (int j = 0; j < 4; j++) { cnt[mmdd[j] - '0']++; } } int res = 0; for (int i = 0; i < 10; i++) { if (cnt[i] > 0) res++; } cout << (res >= K ? "Yes": "No") << endl; return 0; }