Created
January 9, 2016 15:40
-
-
Save whatalnk/2a134fe7eecd79626a18 to your computer and use it in GitHub Desktop.
Codeforces #338 Div2
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
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