結果
問題 |
No.2778 Is there Same letter?
|
ユーザー |
|
提出日時 | 2024-06-19 19:07:05 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 910 bytes |
コンパイル時間 | 16,986 ms |
コンパイル使用メモリ | 378,152 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-19 19:07:24 |
合計ジャッジ時間 | 16,794 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 |
ソースコード
pub mod nayu { pub use std::collections::HashSet; use std::{error::Error, str::FromStr}; fn input_raw_string() -> String { let mut buf = String::new(); std::io::stdin().read_line(&mut buf).unwrap(); buf } pub fn input_string() -> String { input_raw_string().trim().into() } fn input_values<T>() -> T where T: FromStr, <T as FromStr>::Err: Error, { let buf = input_raw_string(); buf.trim().parse().unwrap() } pub fn input_uint_value() -> u64 { input_values() } pub fn output_ifne_yesno<T: PartialEq<U>, U: PartialEq<T>>(left: T, right: U) { println!("{}", if left != right { "Yes" } else { "No" }) } } use nayu::*; fn main() { let n = input_uint_value(); let s = input_string(); output_ifne_yesno(n as usize, s.chars().collect::<HashSet<char>>().len()); }