Last active
January 26, 2016 15:15
-
-
Save whatalnk/e37c30cfdb2abe222e0c to your computer and use it in GitHub Desktop.
AtCoder ABC #030
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, d = gets.chomp.split(" ").map(&:to_f) | |
takahashi = b / a | |
aoki = d / c | |
if takahashi > aoki then | |
puts "TAKAHASHI" | |
elsif takahashi < aoki then | |
puts "AOKI" | |
else | |
puts "DRAW" | |
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, m = gets.chomp.split(" ").map(&:to_i) | |
longer = ((720r/(24*60)) * (n*60 + m)) % 360 | |
shorter = (360r/60) * m | |
r = (longer - shorter).abs.to_f | |
puts [r, 360-r].min |
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) | |
x, y = gets.chomp.split(" ").map(&:to_i) | |
a = gets.chomp.split(" ").map(&:to_i) | |
b = gets.chomp.split(" ").map(&:to_i) | |
tnow = 0 | |
res = 0 | |
while true | |
# A => B | |
tnext = a.bsearch {|v| v >= tnow} | |
break if tnext.nil? | |
tnow = tnext + x | |
# B => A | |
tnext = b.bsearch {|v| v >= tnow} | |
break if tnext.nil? | |
tnow = tnext + y | |
res += 1 | |
end | |
puts res |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment