Submission #3705375


Source Code Expand

#
# File    : D2.rb
# Author  : Kazune Takahashi
# Created : 2018-12-2 21:41:17
# Powered by Visual Studio Code
#

require 'prime'

n = gets.to_i

hash = {}

for i in 2...100
  if i.prime?
    hash[i] = 0
  end
end

for i in 1..n
  i.prime_division.each{|prime, cnt|
    hash[prime] += cnt
  }
end

# p hash

ary = Array.new(100){0}

hash.each{|prime, cnt|
  ary[cnt] += 1
}

98.downto(0){|i|
  ary[i] += ary[i + 1]
}

ans = 0
ans += ary[74]
ans += (ary[4] - 1) * ary[14]
ans += (ary[2] - 1) * ary[24]
ans += (ary[2] - 2) * ary[4] * (ary[4] - 1) / 2

puts ans

Submission Info

Submission Time
Task D - 756
User kazunetakahashi
Language Ruby (2.3.3)
Score 400
Code Size 604 Byte
Status AC
Exec Time 12 ms
Memory 2172 KB

Compile Error

./Main.rb:34: warning: shadowing outer local variable - i

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 20
Set Name Test Cases
Sample a01, a02, a03
All a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20
Case Name Status Exec Time Memory
a01 AC 12 ms 2172 KB
a02 AC 10 ms 1916 KB
a03 AC 11 ms 1916 KB
b04 AC 10 ms 1916 KB
b05 AC 10 ms 1916 KB
b06 AC 10 ms 1916 KB
b07 AC 10 ms 1916 KB
b08 AC 10 ms 1916 KB
b09 AC 10 ms 1916 KB
b10 AC 10 ms 1916 KB
b11 AC 10 ms 1916 KB
b12 AC 11 ms 1916 KB
b13 AC 10 ms 1916 KB
b14 AC 10 ms 1916 KB
b15 AC 10 ms 1916 KB
b16 AC 11 ms 1916 KB
b17 AC 10 ms 1916 KB
b18 AC 10 ms 1916 KB
b19 AC 11 ms 1916 KB
b20 AC 10 ms 1916 KB