Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created January 9, 2016 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whatalnk/2a134fe7eecd79626a18 to your computer and use it in GitHub Desktop.
Save whatalnk/2a134fe7eecd79626a18 to your computer and use it in GitHub Desktop.
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