結果

問題 No.163 cAPSlOCK
コンテスト
ユーザー shigi
提出日時 2026-11-17 15:56:56
言語 Rust
(1.99.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 1 ms / 5,000 ms
+ 51µs
コード長 512 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,383 ms
コンパイル使用メモリ 184,220 KB
実行使用メモリ 9,872 KB
最終ジャッジ日時 2026-11-17 15:57:03
合計ジャッジ時間 6,577 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::collections::HashMap;
use proconio::input;

fn main() {
    let a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    let b = "abcdefghijklmnopqrstuvwxyz";
    let mut h = HashMap::new();
    for i in 0..26 {
        h.insert(a.chars().nth(i).unwrap(), b.chars().nth(i).unwrap());
        h.insert(b.chars().nth(i).unwrap(), a.chars().nth(i).unwrap());
    }

    input!(
        s: String,
    );

    let mut ans = String::from("");
    for c in s.chars() {
        ans.push(h[&c]);
    }

    println!("{}", ans);
}
0