Skip to content

Instantly share code, notes, and snippets.

@ninoseki
Created March 8, 2015 00:12
Show Gist options
  • Save ninoseki/04ee494239d2ec7b1e08 to your computer and use it in GitHub Desktop.
Save ninoseki/04ee494239d2ec7b1e08 to your computer and use it in GitHub Desktop.
Codeforces#294 Div2-B
# http://codeforces.com/contest/519/problem/B
class Errors
def initialize(a, b, c)
@errors = [a, b, c].map(&:sort)
end
def corrected_error(n)
(0..@errors[n - 1].length).each do |idx|
return @errors[n - 1][idx] if @errors[n][idx] != @errors[n - 1][idx]
end
end
end
n = gets.chomp.to_i
a = gets.chomp.split.map(&:to_i)
b = gets.chomp.split.map(&:to_i)
c = gets.chomp.split.map(&:to_i)
erros = Errors.new(a, b, c)
puts erros.corrected_error(1)
puts erros.corrected_error(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment