Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.