結果

問題 No.400 鏡
ユーザー harhogefooharhogefoo
提出日時 2016-10-14 08:05:15
言語 Ruby
(3.4.1)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 227 bytes
コンパイル時間 62 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-11-22 05:54:18
合計ジャッジ時間 1,795 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s = gets.chomp

s.length.times do |i|
  if s[i] == ">"
    s[i] = "<"
  else
    s[i] = ">" if s[i] == "<"
  end
end

(s.length / 2).times do |i|
  tmp = s[i]
  s[i] = s[s.length - 1 - i]
  s[s.length - 1 - i] = tmp
end

puts s
0