Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Last active July 23, 2016 14:29
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/77ebb7c1a9274e01b8847a2ef26b0675 to your computer and use it in GitHub Desktop.
Save whatalnk/77ebb7c1a9274e01b8847a2ef26b0675 to your computer and use it in GitHub Desktop.
AtCoder ABC #042 [Ruby]
a, b, c = gets.chomp.split(" ")
if ((a == "5") && (b == "5") && (c == "7")) || ((a == "7") && (b == "5") && (c == "5")) || ((a == "5") && (b == "7") && (c == "5")) then
puts "YES"
else
puts "NO"
end
n, l = gets.chomp.split(" ").map(&:to_i)
ss = []
n.times do
ss << gets.chomp
end
puts ss.sort.join("")
n, k = gets.chomp.split(" ").map(&:to_i)
d = gets.chomp.split(" ")
re = Regexp.union(d)
while true
if n.to_s.match(re) then
n += 1
else
puts n
exit
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment