結果
問題 |
No.2109 Special Week
|
ユーザー |
|
提出日時 | 2024-07-09 15:34:50 |
言語 | Rust (1.83.0 + proconio) |
結果 |
WA
|
実行時間 | - |
コード長 | 524 bytes |
コンパイル時間 | 12,135 ms |
コンパイル使用メモリ | 390,968 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-09 15:35:05 |
合計ジャッジ時間 | 14,052 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 36 WA * 1 |
ソースコード
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] = (n[0] + 1) % 12; } } println!("{}", if h.len() < n[2] { "No" } else { "Yes" }) }