Create a gist now

Instantly share code, notes, and snippets.

Codeforces #338 Div2
n, m = gets.chomp.split(" ").map(&:to_i)
bulbs = []
n.times do
y = gets.chomp.split(" ").map(&:to_i)
x = y.shift
bulbs += y
end
if bulbs.uniq.length == m then
puts "YES"
else
puts "NO"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment