結果
問題 | No.2109 Special Week |
ユーザー |
![]() |
提出日時 | 2022-10-28 21:22:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 611 bytes |
コンパイル時間 | 1,475 ms |
コンパイル使用メモリ | 170,056 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-06 00:17:37 |
合計ジャッジ時間 | 2,726 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 37 |
ソースコード
#include <bits/stdc++.h> using namespace std; vector<int> day = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int main(){ int M, D, K; cin >> M >> D >> K; vector<bool> used(10, false); for (int i = 0; i < 7; i++){ used[M / 10] = true; used[M % 10] = true; used[D / 10] = true; used[D % 10] = true; D++; if (D > day[M - 1]){ D = 1; M++; if (M == 13){ M = 1; } } } int cnt = 0; for (int i = 0; i < 10; i++){ if (used[i]){ cnt++; } } if (cnt >= K){ cout << "Yes" << endl; } else { cout << "No" << endl; } }