Submission #1149612


Source Code Expand

<?php
// Here your code !
    $n = fgets(STDIN);
    $prime = array();
    $prime[0] = 2;
    for($i=3;$i<=1000;$i+=2){
        $flag = 1;
        foreach ($prime as $value) {
            if($i % $value == 0){;
                $flag = 0;
            }
        }
        if($flag == 1){
            array_push($prime,$i);
        }
    }
    
    $check = array();
    $temp = 0;
    for($i = 1; $i<=$n; $i++){
        foreach ($prime as $value) {
            $temp = $i;
            while($temp % $value == 0){
                $check[$value]++;
                $temp = $temp / $value;
            }
        }
    }
    
//    var_dump($check);
    
    $answer = 1;
    foreach ($check as $value) {
        $answer = $answer * ($value + 1);
        $answer = $answer % 1000000007;
        if($answer<0){
        $answer += 1000000007;
    }
    }
    
//    while($answer > 1000000007){
//        $answer -= 1000000007;
//    }

    echo $answer;
?>

Submission Info

Submission Time
Task C - Factors of Factorial
User norimiso
Language PHP (5.6.30)
Score 300
Code Size 996 Byte
Status AC
Exec Time 23 ms
Memory 3700 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 10
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 13 ms 3700 KB
sample_02.txt AC 12 ms 3576 KB
sample_03.txt AC 23 ms 3576 KB
subtask_1_certain_01.txt AC 12 ms 3576 KB
subtask_1_certain_02.txt AC 12 ms 3576 KB
subtask_1_certain_03.txt AC 23 ms 3576 KB
subtask_1_certain_04.txt AC 22 ms 3576 KB
subtask_1_rand_01.txt AC 17 ms 3576 KB
subtask_1_rand_02.txt AC 18 ms 3576 KB
subtask_1_rand_03.txt AC 17 ms 3576 KB