結果

問題 No.27 板の準備
ユーザー tottoripapertottoripaper
提出日時 2014-11-16 21:07:00
言語 Haskell
(9.8.2)
結果
AC  
実行時間 32 ms / 5,000 ms
コード長 328 bytes
コンパイル時間 11,217 ms
コンパイル使用メモリ 166,156 KB
実行使用メモリ 11,184 KB
最終ジャッジ日時 2023-08-27 03:24:14
合計ジャッジ時間 12,143 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
7,836 KB
testcase_01 AC 4 ms
8,044 KB
testcase_02 AC 12 ms
11,108 KB
testcase_03 AC 6 ms
8,724 KB
testcase_04 AC 22 ms
11,068 KB
testcase_05 AC 22 ms
11,140 KB
testcase_06 AC 22 ms
11,124 KB
testcase_07 AC 22 ms
11,064 KB
testcase_08 AC 32 ms
11,080 KB
testcase_09 AC 22 ms
11,084 KB
testcase_10 AC 22 ms
11,152 KB
testcase_11 AC 22 ms
11,116 KB
testcase_12 AC 22 ms
11,036 KB
testcase_13 AC 22 ms
11,048 KB
testcase_14 AC 12 ms
11,120 KB
testcase_15 AC 22 ms
11,056 KB
testcase_16 AC 7 ms
9,228 KB
testcase_17 AC 22 ms
11,184 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.Applicative

main = do
  vs <- map read . words <$> getLine
  let
    f [] n = if n == 0 then 0 else 10000
    f ys@(x:xs) n
      | x <= n = min (f ys (n-x) + 1) (f xs n)
      | otherwise = f xs n
    mn = minimum [sum $ map (f [c,b,a]) vs | a <- [1..30], b <- [a..30], c <- [b..30]]
    in print mn
0