結果

問題 No.18 うーさー暗号
コンテスト
ユーザー rustGanbaruman
提出日時 2026-02-10 12:17:30
言語 Rust
(1.92.0 + proconio + num + itertools)
結果
WA  
実行時間 -
コード長 387 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 17,333 ms
コンパイル使用メモリ 199,316 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2026-02-10 12:17:49
合計ジャッジ時間 3,468 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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:u8 = (c - b'a' -((i % 26) as u8 + 1)) % 26 + b'a';
    output.push(result as char);
  }

  println!("{}",output.iter().map(|x| x.to_string().to_uppercase()).collect::<String>());
}
0