Created
March 19, 2017 08:51
-
-
Save whatalnk/a9c7a58c60a5051effbe3c500d7bcdc4 to your computer and use it in GitHub Desktop.
AtCOder ABC #010 [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
s = gets.chomp | |
puts s + "pp" |
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 = gets.chomp.to_i | |
a = gets.chomp.split(" ").map(&:to_i) | |
res = 0 | |
a.each do |i| | |
case i | |
when 2 then res += 1 | |
when 4 then res += 1 | |
when 5 then res += 2 | |
when 6 then res += 3 | |
when 8 then res += 1 | |
end | |
end | |
puts res |
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
txa, tya, txb, tyb, t, v = gets.chomp.split(" ").map(&:to_i) | |
n = gets.chomp.to_i | |
ret = "NO" | |
n.times do | |
x, y = gets.chomp.split(" ").map(&:to_i) | |
l1 = Math.sqrt((txa - x)**2 + (tya - y)**2) | |
l2 = Math.sqrt((x - txb)**2 + (y - tyb)**2) | |
if (t * v) >= (l1 + l2) then | |
ret = "YES" | |
end | |
end | |
puts ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment