結果

問題 No.18 うーさー暗号
ユーザー what_alnkwhat_alnk
提出日時 2015-09-02 21:09:42
言語 Ruby
(3.3.0)
結果
AC  
実行時間 86 ms / 5,000 ms
コード長 187 bytes
コンパイル時間 227 ms
コンパイル使用メモリ 11,324 KB
実行使用メモリ 15,520 KB
最終ジャッジ日時 2023-09-21 11:51:53
合計ジャッジ時間 2,080 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
15,268 KB
testcase_01 AC 83 ms
15,144 KB
testcase_02 AC 81 ms
15,132 KB
testcase_03 AC 86 ms
15,520 KB
testcase_04 AC 84 ms
15,324 KB
testcase_05 AC 84 ms
15,248 KB
testcase_06 AC 84 ms
15,508 KB
testcase_07 AC 85 ms
15,484 KB
testcase_08 AC 86 ms
15,212 KB
testcase_09 AC 86 ms
15,424 KB
testcase_10 AC 84 ms
15,232 KB
testcase_11 AC 84 ms
15,116 KB
testcase_12 AC 85 ms
15,224 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s = gets.chomp
alphabets = [("A".."Z").to_a, (0..25).to_a].transpose.to_h
res = ""
s.split("").each_with_index do |c, i|
  res += alphabets.key((alphabets[c] - (i + 1)) % 26)
end
puts res
0