Create a gist now

Instantly share code, notes, and snippets.

AtCoder ABC #055 [Ruby]
n = gets.chomp.to_i
x = 800 * n
y = (n / 15) * 200
puts x - y
require 'prime'
h = Hash.new(0)
n = gets.chomp.to_i
1.upto(n) do |i|
Prime.prime_division(i).each do |a, b|
h[a] += b
end
end
ret = 1
h.each do |k, v|
ret *= (k ** v) % (10**9 + 7)
end
puts ret % (10**9 + 7)
n, m = gets.chomp.split(" ").map(&:to_i)
ret = 0
if n >= m / 2 then
ret += (m / 2)
else
ret += n
ret += ((m - 2 * n) / 4)
end
puts ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment