結果

問題 No.26 シャッフルゲーム
ユーザー fshutofshuto
提出日時 2019-04-30 17:49:55
言語 Ruby
(3.2.2)
結果
AC  
実行時間 85 ms / 5,000 ms
コード長 135 bytes
コンパイル時間 43 ms
コンパイル使用メモリ 11,592 KB
実行使用メモリ 15,308 KB
最終ジャッジ日時 2023-08-28 23:42:00
合計ジャッジ時間 1,484 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
15,252 KB
testcase_01 AC 77 ms
15,252 KB
testcase_02 AC 79 ms
15,148 KB
testcase_03 AC 77 ms
15,308 KB
testcase_04 AC 76 ms
15,128 KB
testcase_05 AC 77 ms
15,308 KB
testcase_06 AC 76 ms
15,044 KB
testcase_07 AC 77 ms
15,272 KB
testcase_08 AC 79 ms
15,088 KB
testcase_09 AC 80 ms
15,092 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i
m = gets.to_i
m.times do
  p, q = gets.split.map(&:to_i)
  if n == p
    n = q 
  elsif n == q
    n = p
  end
end
puts n
0