結果
問題 | No.1362 [Zelkova 8th Tune] Black Sheep |
ユーザー |
|
提出日時 | 2021-01-22 22:38:03 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 14 ms / 1,000 ms |
コード長 | 623 bytes |
コンパイル時間 | 16,144 ms |
コンパイル使用メモリ | 383,372 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-28 03:34:12 |
合計ジャッジ時間 | 15,400 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 38 |
ソースコード
use std::collections::HashMap;use std::io::*;fn main() {let mut s: String = String::new();std::io::stdin().read_to_string(&mut s).ok();let mut itr = s.trim().split_whitespace();let s: Vec<char> = itr.next().unwrap().chars().collect();let mut st = HashMap::<char, usize>::new();for &c in s.iter() {let p = st.entry(c).or_insert(0);*p += 1;}for (k, v) in &st {if *v == 1 {let mut pos = 0;while s[pos] != *k {pos += 1;}println!("{} {}", pos + 1, k);return;}}}