結果

問題 No.2109 Special Week
ユーザー
提出日時 2024-07-09 15:37:26
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 546 bytes
コンパイル時間 11,838 ms
コンパイル使用メモリ 387,032 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-09 15:37:41
合計ジャッジ時間 13,762 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::collections::HashSet;

fn main() {
	let mut s = String::new();
	std::io::stdin().read_line(&mut s).ok();
	let mut n: Vec<usize> = s.split_whitespace().flat_map(str::parse).collect();
	let d = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
	let mut h = HashSet::new();
	for _ in 0..7 {
		format!("{:02}{:02}", n[0], n[1]).chars().for_each(|c| {
			h.insert(c);
		});
		n[1] += 1;
		if n[1] > d[n[0]] {
			n[1] = 1;
			n[0] = if n[0] == 12 { 1 } else { n[0] + 1 };
		}
	}
	println!("{}", if h.len() < n[2] { "No" } else { "Yes" })
}
0