結果
問題 |
No.2109 Special Week
|
ユーザー |
![]() |
提出日時 | 2023-09-23 23:13:07 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,087 bytes |
コンパイル時間 | 1,837 ms |
コンパイル使用メモリ | 196,608 KB |
最終ジャッジ日時 | 2025-02-17 01:49:40 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 RE * 1 |
other | AC * 15 WA * 5 RE * 17 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:21:13: warning: ‘td’ may be used uninitialized [-Wmaybe-uninitialized] 21 | int td = td + i; | ^~ main.cpp:21:13: note: ‘td’ was declared here 21 | int td = td + i; | ^~
ソースコード
#include <bits/stdc++.h> #include<iostream> #include<map> #include<vector> #include <algorithm> #include<math.h> #include <iomanip> #include<set> #include <numeric> #include<string> using ll = long long; using namespace std; int main() { ll m, d, k, cnt = 0, td; cin >> m >> d >> k; vector<int> dd = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, v(10); td = d; for (int i = 0; i < 7; i++){ int td = td + i; if (td > dd[m-1]){ td -= dd[m-1]; m++; } if (m == 13) m = 1; if (m < 10) { v[0]++; v[m]++; } else { v[1]++; v[m%10]++; } if (td < 10){ v[0]++; v[td%10]++; } else if (td < 20){ v[1]++; v[td%10]++; } else if (td < 30){ v[2]++; v[td%10]++; } else { v[3]++; v[td%10]++; } } for (int i = 0; i < 10; i++){ if (v[i]) cnt++; } cout << ((cnt >= k) ? "Yes" : "No") << endl; }