結果

問題 No.729 文字swap
ユーザー Soya SanoSoya Sano
提出日時 2018-09-22 15:33:44
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 225 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 11,320 KB
実行使用メモリ 15,348 KB
最終ジャッジ日時 2023-09-25 11:06:00
合計ジャッジ時間 2,068 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 80 ms
15,268 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 80 ms
15,148 KB
testcase_08 AC 80 ms
15,048 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:5: warning: assigned but unused variable - tmp
Syntax OK

ソースコード

diff #

original = gets.chomp.split("")

indexes = gets.chomp.split(" ").map{|num| num.to_i }

tmp = original[indexes[0]]
original[indexes[0]] = original[indexes[1]]
original[indexes[1]] = original[indexes[0]]

puts original.join("")
0