結果

問題 No.5 数字のブロック
ユーザー Yuzu MashiroYuzu Mashiro
提出日時 2021-02-25 13:18:03
言語 Haskell
(9.6.2)
結果
AC  
実行時間 33 ms / 5,000 ms
コード長 316 bytes
コンパイル時間 4,024 ms
コンパイル使用メモリ 166,588 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2023-10-26 03:40:25
合計ジャッジ時間 6,156 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,128 KB
testcase_01 AC 3 ms
5,160 KB
testcase_02 AC 2 ms
5,120 KB
testcase_03 AC 22 ms
11,120 KB
testcase_04 AC 22 ms
10,096 KB
testcase_05 AC 22 ms
11,120 KB
testcase_06 AC 22 ms
10,304 KB
testcase_07 AC 23 ms
10,096 KB
testcase_08 AC 22 ms
10,496 KB
testcase_09 AC 12 ms
9,520 KB
testcase_10 AC 23 ms
11,120 KB
testcase_11 AC 22 ms
10,096 KB
testcase_12 AC 22 ms
11,120 KB
testcase_13 AC 22 ms
11,120 KB
testcase_14 AC 3 ms
5,776 KB
testcase_15 AC 4 ms
6,404 KB
testcase_16 AC 22 ms
11,120 KB
testcase_17 AC 32 ms
11,472 KB
testcase_18 AC 22 ms
11,200 KB
testcase_19 AC 33 ms
11,520 KB
testcase_20 AC 2 ms
5,128 KB
testcase_21 AC 3 ms
5,124 KB
testcase_22 AC 3 ms
5,124 KB
testcase_23 AC 2 ms
5,132 KB
testcase_24 AC 4 ms
6,680 KB
testcase_25 AC 5 ms
8,188 KB
testcase_26 AC 3 ms
5,128 KB
testcase_27 AC 2 ms
5,124 KB
testcase_28 AC 2 ms
5,120 KB
testcase_29 AC 22 ms
10,096 KB
testcase_30 AC 12 ms
9,544 KB
testcase_31 AC 2 ms
5,120 KB
testcase_32 AC 3 ms
5,120 KB
testcase_33 AC 2 ms
5,120 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 qualified Data.List (sort)

func :: Int -> [Int] -> Int
func _ [] = 0
func size (x : xs)
  | x > size = 0
  | otherwise = (+) 1 $ func (size - x) xs

main :: IO ()
main = do
  l <- read <$> getLine :: IO Int
  _ <- getLine
  ws <- map read . words <$> getLine :: IO [Int]
  print $ func l $ Data.List.sort ws
0