Last active
July 23, 2016 14:29
-
-
Save whatalnk/77ebb7c1a9274e01b8847a2ef26b0675 to your computer and use it in GitHub Desktop.
AtCoder ABC #042 [Ruby]
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
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 |
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, l = gets.chomp.split(" ").map(&:to_i) | |
ss = [] | |
n.times do | |
ss << gets.chomp | |
end | |
puts ss.sort.join("") |
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, 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