結果

問題 No.376 立方体のN等分 (2)
ユーザー pekempeypekempey
提出日時 2016-07-29 03:03:35
言語 Haskell
(9.8.2)
結果
TLE  
実行時間 -
コード長 508 bytes
コンパイル時間 1,865 ms
コンパイル使用メモリ 168,448 KB
実行使用メモリ 16,796 KB
最終ジャッジ日時 2024-04-24 10:41:02
合計ジャッジ時間 25,171 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 1,854 ms
9,344 KB
testcase_03 AC 3,946 ms
8,960 KB
testcase_04 AC 2,632 ms
9,344 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 45 ms
8,064 KB
testcase_09 AC 180 ms
8,704 KB
testcase_10 AC 3,452 ms
10,112 KB
testcase_11 AC 636 ms
9,216 KB
testcase_12 AC 1,576 ms
9,088 KB
testcase_13 AC 601 ms
8,448 KB
testcase_14 AC 777 ms
9,216 KB
testcase_15 AC 455 ms
9,728 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

divisors k = filter (\ x -> k `rem` x == 0)
divisors2 i n = map (\ x -> [x, n `quot` x]) . divisors n . takeWhile (\ x -> x ^ 2 <= n) $ [i .. ]
divisors3 n = concat . map (\ x -> map (x : ) $ divisors2 x (n `quot` x)) . divisors n . takeWhile (\ x -> x ^ 3 <= n) $ [1 .. ]

evaluate (p : q : r : []) = (p - 1) + (q - 1) + (r - 1)

solveMin = minimum . map evaluate . divisors3
solveMax = (+ (-1))

main = do
    n <- readLn :: IO Integer
    putStrLn $ (show . solveMin) n ++ " " ++ (show . solveMax) n
    
0