Created
March 8, 2015 00:12
-
-
Save ninoseki/04ee494239d2ec7b1e08 to your computer and use it in GitHub Desktop.
Codeforces#294 Div2-B
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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