結果

問題 No.1362 [Zelkova 8th Tune] Black Sheep
ユーザー phsplsphspls
提出日時 2022-10-08 12:10:09
言語 Rust
(1.77.0)
結果
AC  
実行時間 16 ms / 1,000 ms
コード長 419 bytes
コンパイル時間 3,089 ms
コンパイル使用メモリ 150,492 KB
実行使用メモリ 8,448 KB
最終ジャッジ日時 2023-09-04 15:05:14
合計ジャッジ時間 4,514 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 13 ms
7,212 KB
testcase_14 AC 12 ms
6,772 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 7 ms
4,380 KB
testcase_17 AC 14 ms
7,676 KB
testcase_18 AC 8 ms
5,148 KB
testcase_19 AC 15 ms
8,108 KB
testcase_20 AC 10 ms
5,880 KB
testcase_21 AC 8 ms
5,180 KB
testcase_22 AC 12 ms
7,188 KB
testcase_23 AC 15 ms
8,436 KB
testcase_24 AC 16 ms
8,436 KB
testcase_25 AC 15 ms
8,392 KB
testcase_26 AC 15 ms
8,404 KB
testcase_27 AC 16 ms
8,400 KB
testcase_28 AC 16 ms
8,348 KB
testcase_29 AC 15 ms
8,424 KB
testcase_30 AC 15 ms
8,348 KB
testcase_31 AC 15 ms
8,448 KB
testcase_32 AC 15 ms
8,400 KB
testcase_33 AC 15 ms
8,396 KB
testcase_34 AC 15 ms
8,440 KB
testcase_35 AC 1 ms
4,380 KB
testcase_36 AC 1 ms
4,376 KB
testcase_37 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::collections::HashMap;


fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    let s = s.trim().chars().collect::<Vec<_>>();

    let mut wordmap = HashMap::new();
    for (i, &c) in s.iter().enumerate() { wordmap.entry(c).or_insert(vec![]).push(i); }
    for (&c, v) in wordmap.iter() {
        if v.len() == 1 {
            println!("{} {}", v[0]+1, c);
        }
    }
}
0