結果

問題 No.73 helloworld
ユーザー momen999momen999
提出日時 2017-06-18 09:17:44
言語 Haskell
(9.8.2)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 579 bytes
コンパイル時間 1,190 ms
コンパイル使用メモリ 162,300 KB
実行使用メモリ 7,216 KB
最終ジャッジ日時 2023-09-12 13:03:08
合計ジャッジ時間 1,997 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,040 KB
testcase_01 AC 2 ms
7,008 KB
testcase_02 AC 3 ms
7,024 KB
testcase_03 AC 3 ms
7,004 KB
testcase_04 AC 3 ms
7,108 KB
testcase_05 AC 3 ms
7,160 KB
testcase_06 AC 2 ms
7,092 KB
testcase_07 AC 3 ms
7,036 KB
testcase_08 AC 2 ms
7,036 KB
testcase_09 AC 2 ms
7,216 KB
testcase_10 AC 3 ms
7,112 KB
testcase_11 AC 2 ms
7,088 KB
testcase_12 AC 3 ms
7,028 KB
testcase_13 AC 2 ms
7,068 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Control.Monad

--
solve as = hsum * (maxl 0 2) * (maxo 0 1)
    where
        maxl m i    | i < l     = maxl (max m (((i * (i - 1)) `div` 2) * (l - i))) (i + 1)
                    | otherwise = m
        maxo m i    | i < o     = maxo (max m (i * (o - i))) (i + 1)
                    | otherwise = m
        hsum = foldr (*) 1 hewrd
        hewrd = [d,e,h,r,w]
        d = as !! 3
        e = as !! 4
        h = as !! 7
        l = as !! 11
        o = as !! 14
        r = as !! 17
        w = as !! 22
--

main = do
    as <- replicateM 26 readLn
    print $ solve as
0