結果

問題 No.26 シャッフルゲーム
ユーザー nonokai10nonokai10
提出日時 2018-02-26 03:09:36
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 207 bytes
コンパイル時間 41 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-04-28 22:43:32
合計ジャッジ時間 1,665 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 90 ms
12,032 KB
testcase_02 AC 91 ms
12,160 KB
testcase_03 AC 94 ms
12,032 KB
testcase_04 WA -
testcase_05 AC 90 ms
12,160 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 88 ms
12,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

array = ['x', 'x', 'x']
array[gets.to_i - 1] = 'o'
def swap(array, a, b)
  array[a], array[b] = array[b], array[a]
end
gets.to_i.times do
  swap(array, *gets.split.map(&:to_i))
end
puts array.index('o') + 1
0