結果
| 問題 | No.18 うーさー暗号 |
| コンテスト | |
| ユーザー |
harhogefoo
|
| 提出日時 | 2016-10-05 08:22:59 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 52 ms / 5,000 ms |
| + 535µs | |
| コード長 | 321 bytes |
| 記録 | |
| コンパイル時間 | 9 ms |
| コンパイル使用メモリ | 8,832 KB |
| 実行使用メモリ | 14,976 KB |
| 最終ジャッジ日時 | 2026-08-10 21:16:12 |
| 合計ジャッジ時間 | 2,200 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
コンパイルメッセージ
Syntax OK
ソースコード
def convert_alphabet(byte, shift_count)
shift_count = shift_count % 26
if byte - shift_count < 65
byte = byte - shift_count + 26
else
byte = byte - shift_count
end
"" << byte
end
cipher = gets.chomp
j = 1
answer = ""
cipher.each_byte do |b|
answer += convert_alphabet(b, j)
j += 1
end
puts answer
harhogefoo