Submission #1690369


Source Code Expand

require 'prime'
bound = 10**9
gen = Prime::EratosthenesGenerator.new
gen.next
primes = 200.times.map{gen.next}
100.times{
  prod = 1
  ps = []
  loop{
    ps = 3.times.map{primes.sample}.sort
    prod = ps.zip([3,2,1]).map{|a|a.reduce(:**)}.reduce(:*)
    break if prod<=bound
  }
  prod **= 2 while prod**2<=bound
  #prod *= ps[0] if prod*ps[0]<=bound
  prod *= 6 while prod*6<=bound
  prod *= 2 while prod*2<=bound
  
  p prod
}

Submission Info

Submission Time
Task A - 約数をたくさんつくろう!
User refle
Language Ruby (2.3.3)
Score 7071
Code Size 449 Byte
Status AC
Exec Time 35 ms
Memory 2300 KB

Judge Result

Set Name test_01
Score / Max Score 7071 / 100000
Status
AC × 1
Set Name Test Cases
test_01 noinput.txt
Case Name Status Exec Time Memory
noinput.txt AC 35 ms 2300 KB