結果
問題 |
No.2778 Is there Same letter?
|
ユーザー |
|
提出日時 | 2025-10-04 20:44:00 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 371 bytes |
コンパイル時間 | 23,891 ms |
コンパイル使用メモリ | 399,408 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-10-04 20:44:25 |
合計ジャッジ時間 | 14,471 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
ソースコード
use proconio::input; use std::collections::HashMap; fn main() { input! { _n: usize, s: String, } let mut hash_map = HashMap::new(); for c in s.chars() { *hash_map.entry(c).or_insert(0) += 1; } let ans = if hash_map.into_values().all(|v| v == 1) { "No" } else { "Yes" }; println!("{ans}"); }