結果

問題 No.18 うーさー暗号
ユーザー shi-moshi-mo
提出日時 2016-08-31 17:39:54
言語 Ruby
(3.2.2)
結果
AC  
実行時間 82 ms / 5,000 ms
コード長 145 bytes
コンパイル時間 34 ms
コンパイル使用メモリ 11,232 KB
実行使用メモリ 15,476 KB
最終ジャッジ日時 2023-09-21 12:25:05
合計ジャッジ時間 1,786 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,032 KB
testcase_01 AC 81 ms
15,096 KB
testcase_02 AC 82 ms
15,116 KB
testcase_03 AC 79 ms
15,476 KB
testcase_04 AC 78 ms
15,272 KB
testcase_05 AC 77 ms
15,156 KB
testcase_06 AC 80 ms
15,304 KB
testcase_07 AC 79 ms
15,444 KB
testcase_08 AC 77 ms
15,464 KB
testcase_09 AC 79 ms
15,376 KB
testcase_10 AC 78 ms
15,228 KB
testcase_11 AC 78 ms
15,236 KB
testcase_12 AC 78 ms
15,404 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s = gets.chomp

a = ('A'..'Z').to_a
cA = 'A'.ord

d = ''
s.each_char.with_index do |c, j|
  i = j + 1
  d += a[(c.ord - cA - i) % 26]
end
puts d
0