結果

問題 No.18 うーさー暗号
ユーザー fungsi
提出日時 2025-09-17 12:05:53
言語 Crystal
(1.14.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 227 bytes
コンパイル時間 13,974 ms
コンパイル使用メモリ 309,592 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-09-17 12:06:11
合計ジャッジ時間 15,096 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

s = gets.not_nil!.chomp
d = 1
result = String.build do |str|
  s.each_char do |c|
    current = c.ord - 'A'.ord
    new_char = (current - d + 26) % 26 + 'A'.ord
    str << new_char.chr
    d = (d + 1) % 26
  end
end
puts result
0