結果

問題 No.2109 Special Week
ユーザー forest3
提出日時 2022-11-01 11:22:09
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 480 bytes
コンパイル時間 1,894 ms
コンパイル使用メモリ 175,540 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-16 05:28:39
合計ジャッジ時間 3,110 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
	int M, D, K;
	cin >> M >> D >> K;

	vector<int> m( 12, 31 );
	m[1] = 28;
	m[3] = 30;
	m[5] = 30;
	m[8] = 30;
	m[10] = 30;
	int l = m[ M - 1 ];
	map<char, int> mp;
	for( int i = 0; i < 7; i++ ) {
		char c[8];
		sprintf( c, "%02d%02d", M, D );
		for( int j = 0; j < 4; j++ ) mp[ c[j] ]++;
		D++;
		if( D > l ) {
			M++;
			D = 1;
		}
	}
	string ans = "No";
	if( (int)mp.size() >= K ) ans = "Yes";

	cout << ans << endl;
}
0