Submission #1791830
Source Code Expand
# Your code here!
n=gets.to_i
array=[2,3,5,7,11,13,17,19,23,29,31]
array2=[0,0,0,0,0,0,0,0,0,0,0]
array3=[[2,0],[3,0],[5,0],[7,0],[11,0],[13,0],[17,0],[19,0],[23,0],[29,0],[31,0]]
j=1
k=j+1
n.times{
loop{
i=0
11.times{
if j%array[i]==0
j=j/array[i]
array3[i][1]+=1
break
else
i+=1
end
}
if j==1
break
end
if i==11 && array3.flatten.include?(j)
nnn=array3.flatten.index(j)
array3[nnn/2][1]+=1
break
elsif i==11
array3<<[j,1]
break
end
}
j=k
k=k+1
}
answer=1
kk=0
array3.length.times{
answer=answer*(array3[kk][1]+1)
answer=answer%1000000007
kk+=1
}
puts answer
Submission Info
Submission Time |
|
Task |
C - Factors of Factorial |
User |
hamasugar |
Language |
Ruby (2.3.3) |
Score |
300 |
Code Size |
750 Byte |
Status |
AC |
Exec Time |
43 ms |
Memory |
3452 KB |
Compile Error
./Main.rb:6: warning: assigned but unused variable - array2
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
300 / 300 |
Status |
|
|
Set Name |
Test Cases |
Sample |
sample_01.txt, sample_02.txt, sample_03.txt |
All |
sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_certain_01.txt, subtask_1_certain_02.txt, subtask_1_certain_03.txt, subtask_1_certain_04.txt, subtask_1_rand_01.txt, subtask_1_rand_02.txt, subtask_1_rand_03.txt |
Case Name |
Status |
Exec Time |
Memory |
sample_01.txt |
AC |
7 ms |
1788 KB |
sample_02.txt |
AC |
7 ms |
1788 KB |
sample_03.txt |
AC |
43 ms |
3452 KB |
subtask_1_certain_01.txt |
AC |
8 ms |
1788 KB |
subtask_1_certain_02.txt |
AC |
7 ms |
1788 KB |
subtask_1_certain_03.txt |
AC |
42 ms |
3452 KB |
subtask_1_certain_04.txt |
AC |
43 ms |
3452 KB |
subtask_1_rand_01.txt |
AC |
17 ms |
2300 KB |
subtask_1_rand_02.txt |
AC |
19 ms |
2428 KB |
subtask_1_rand_03.txt |
AC |
14 ms |
2172 KB |