Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created February 25, 2017 13:44
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/db740f6b7b232527492cdfadedd62662 to your computer and use it in GitHub Desktop.
Save whatalnk/db740f6b7b232527492cdfadedd62662 to your computer and use it in GitHub Desktop.
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