結果

問題 No.18 うーさー暗号
ユーザー osyo-mangaosyo-manga
提出日時 2023-08-10 15:48:04
言語 Ruby
(3.4.1)
結果
AC  
実行時間 101 ms / 5,000 ms
コード長 237 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 12,544 KB
最終ジャッジ日時 2024-11-16 22:34:25
合計ジャッジ時間 2,289 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def decode(char, index)
  list = ("A".."Z").to_a
  list[(list.index(char) - index) % 26]
end

# # pp decode("K", 3)
# # pp decode("A", 3)
# pp decode("A", 24)


S = gets.chomp

puts S.chars.map.with_index(1) { |c, i| decode(c, i) }.join
0