結果
| 問題 |
No.2109 Special Week
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-28 22:00:09 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 12 ms / 2,000 ms |
| コード長 | 571 bytes |
| コンパイル時間 | 555 ms |
| コンパイル使用メモリ | 60,032 KB |
| 最終ジャッジ日時 | 2025-02-08 14:29:47 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d %d %d", &M, &D, &K);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<cstdio>
#include<bitset>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
int days_of_month[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
bitset<10> included;
int main(){
int M, D, K;
scanf("%d %d %d", &M, &D, &K);
auto to_digit = [&](int x){
included.set(x/10);
included.set(x%10);
};
rep(_,7){
to_digit(M);
to_digit(D);
if(++D > days_of_month[M]){
D = 1;
if(M == 12) M = 1;
}
}
printf((int)included.count() >= K ? "Yes\n" : "No\n");
}