Skip to content

Instantly share code, notes, and snippets.

@whatalnk whatalnk/yc-no026.rb
Created Dec 28, 2015

What would you like to do?
yukicoder No.026
# [No.26 シャッフルゲーム - yukicoder](
n = gets.chomp.to_i
m = gets.chomp.to_i
cups =, false)
cups[n] = true
m.times do
p_, q_ = gets.chomp.split(" ").map(&:to_i)
cups[p_], cups[q_] = cups[q_], cups[p_]
puts cups.index(true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.