Submission #1241464
Source Code Expand
import Data.List main = do n <- readLn print $ solve n `mod` (10^9 + 7) solve :: Integer -> Integer solve n = product $ map (+1) $ factor [2..n] factor :: [Integer] -> [Integer] factor = map (fromIntegral . length) . group . sort . concatMap factors factors :: Integer -> [Integer] factors n | n <= 1 = [] | null xs = [n] | otherwise = let x = head xs in x : factors (n`div`x) where m = floor $ sqrt $ fromIntegral n ps = [2..m] xs = filter (\p -> n `mod` p == 0) ps
Submission Info
Submission Time | |
---|---|
Task | C - Factors of Factorial |
User | iyou1993 |
Language | Haskell (GHC 7.10.3) |
Score | 300 |
Code Size | 568 Byte |
Status | AC |
Exec Time | 8 ms |
Memory | 1788 KB |
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 | 2 ms | 508 KB |
sample_02.txt | AC | 2 ms | 508 KB |
sample_03.txt | AC | 8 ms | 1788 KB |
subtask_1_certain_01.txt | AC | 2 ms | 508 KB |
subtask_1_certain_02.txt | AC | 2 ms | 508 KB |
subtask_1_certain_03.txt | AC | 5 ms | 1532 KB |
subtask_1_certain_04.txt | AC | 5 ms | 1660 KB |
subtask_1_rand_01.txt | AC | 3 ms | 1020 KB |
subtask_1_rand_02.txt | AC | 3 ms | 1020 KB |
subtask_1_rand_03.txt | AC | 2 ms | 1020 KB |