結果
問題 | No.2109 Special Week |
ユーザー |
|
提出日時 | 2022-10-28 21:25:37 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 655 bytes |
コンパイル時間 | 1,628 ms |
コンパイル使用メモリ | 173,204 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-06 00:23:23 |
合計ジャッジ時間 | 2,762 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 37 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int y, m, d, k; cin >> m >> d >> k; string s; vector<int> da = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; for(int i = 0; i < 7; i++){ s += to_string(m); if(m < 10)s += '0'; s += to_string(d); if(d < 10)s += '0'; d++; if(d > da[m - 1]){ m++; if(m == 13)m = 1; d = 1; } } sort(s.begin(), s.end()); s.erase(unique(s.begin(), s.end()), s.end()); cout << (s.size() >= k ? "Yes" : "No") << '\n'; }