結果

問題 No.27 板の準備
ユーザー aimyaimy
提出日時 2017-06-11 18:36:13
言語 Haskell
(9.8.2)
結果
RE  
実行時間 -
コード長 314 bytes
コンパイル時間 3,365 ms
コンパイル使用メモリ 166,700 KB
実行使用メモリ 9,340 KB
最終ジャッジ日時 2023-10-24 21:09:21
合計ジャッジ時間 4,520 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 2 ms
5,256 KB
testcase_02 AC 13 ms
9,000 KB
testcase_03 AC 3 ms
5,316 KB
testcase_04 AC 12 ms
8,956 KB
testcase_05 AC 7 ms
7,444 KB
testcase_06 AC 22 ms
9,340 KB
testcase_07 AC 22 ms
9,340 KB
testcase_08 AC 32 ms
9,340 KB
testcase_09 AC 22 ms
9,340 KB
testcase_10 AC 22 ms
9,340 KB
testcase_11 AC 12 ms
8,204 KB
testcase_12 AC 22 ms
9,340 KB
testcase_13 AC 12 ms
8,332 KB
testcase_14 AC 6 ms
6,988 KB
testcase_15 AC 22 ms
9,340 KB
testcase_16 AC 3 ms
5,496 KB
testcase_17 AC 22 ms
9,340 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Data.List

main = do
 vs <- sort . map read . words <$> getLine
 print (ita vs)

ita vs@[v1,v2,v3,v4] = minimum $ do
 x <- [1 .. v4]
 y <- [x+1 .. v4]
 z <- [y+1 .. v4]
 return $ sum $ map (f [x,y,z]) vs

f _ 0 = 0
f [] v = 10000
f (w:ws) v
 | w > v = f ws v
 | otherwise = min (f (w:ws) (v-w) + 1) (f ws v)
0