結果
| 問題 | No.18 うーさー暗号 |
| コンテスト | |
| ユーザー |
rustGanbaruman
|
| 提出日時 | 2026-02-10 12:24:39 |
| 言語 | Rust (1.92.0 + proconio + num + itertools) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 455 bytes |
| 記録 | |
| コンパイル時間 | 1,258 ms |
| コンパイル使用メモリ | 201,800 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-02-10 12:24:42 |
| 合計ジャッジ時間 | 2,790 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
ソースコード
use proconio::input;
fn main() {
input! {
mut sentence:String
}
sentence = sentence.to_lowercase();
let mut output: Vec<char> = vec![];
for (i, c) in sentence.bytes().enumerate() {
let result: i32 = (c as i32 - b'a' as i32 - (i as i32 + 1)).rem_euclid(26) + b'a' as i32;
output.push(result as u8 as char);
}
println!("{}",output.iter().map(|x|x.to_string().to_uppercase()).collect::<String>()
);
}
rustGanbaruman