結果

問題 No.18 うーさー暗号
ユーザー riokuma0810riokuma0810
提出日時 2015-08-17 00:56:19
言語 Ruby
(3.3.0)
結果
AC  
実行時間 88 ms / 5,000 ms
コード長 283 bytes
コンパイル時間 237 ms
コンパイル使用メモリ 11,360 KB
実行使用メモリ 15,272 KB
最終ジャッジ日時 2023-09-21 11:50:57
合計ジャッジ時間 2,423 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,260 KB
testcase_01 AC 83 ms
15,024 KB
testcase_02 AC 84 ms
15,140 KB
testcase_03 AC 88 ms
15,144 KB
testcase_04 AC 85 ms
15,268 KB
testcase_05 AC 85 ms
15,248 KB
testcase_06 AC 88 ms
15,064 KB
testcase_07 AC 87 ms
15,148 KB
testcase_08 AC 87 ms
15,164 KB
testcase_09 AC 88 ms
15,072 KB
testcase_10 AC 84 ms
15,272 KB
testcase_11 AC 84 ms
15,148 KB
testcase_12 AC 86 ms
15,272 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

ary = []
c = 0

("A".."Z").each do |alph|
  ary << alph
end

str = gets.chomp


ary2 = []
ary2 = str.chars
ary2.each do |i|
  c += 1
  ary.each do |ii|
    if i == ii
      num = ary.index(ii) - c
      while num < 0
        num += 26
      end
      print ary[num]
    end
  end
end
0