結果

問題 No.5 数字のブロック
ユーザー maichanmaichan
提出日時 2019-07-22 13:17:15
言語 Haskell
(9.8.2)
結果
AC  
実行時間 932 ms / 5,000 ms
コード長 355 bytes
コンパイル時間 660 ms
コンパイル使用メモリ 164,128 KB
実行使用メモリ 14,144 KB
最終ジャッジ日時 2023-09-05 23:16:32
合計ジャッジ時間 9,141 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,100 KB
testcase_01 AC 3 ms
7,156 KB
testcase_02 AC 3 ms
7,028 KB
testcase_03 AC 353 ms
13,216 KB
testcase_04 AC 232 ms
12,604 KB
testcase_05 AC 572 ms
14,144 KB
testcase_06 AC 252 ms
12,632 KB
testcase_07 AC 172 ms
12,572 KB
testcase_08 AC 312 ms
13,076 KB
testcase_09 AC 52 ms
11,416 KB
testcase_10 AC 683 ms
13,052 KB
testcase_11 AC 162 ms
12,464 KB
testcase_12 AC 382 ms
13,476 KB
testcase_13 AC 562 ms
12,936 KB
testcase_14 AC 4 ms
8,164 KB
testcase_15 AC 6 ms
10,540 KB
testcase_16 AC 612 ms
13,712 KB
testcase_17 AC 842 ms
12,824 KB
testcase_18 AC 732 ms
14,076 KB
testcase_19 AC 932 ms
13,332 KB
testcase_20 AC 2 ms
7,172 KB
testcase_21 AC 2 ms
7,168 KB
testcase_22 AC 2 ms
7,108 KB
testcase_23 AC 2 ms
7,080 KB
testcase_24 AC 7 ms
11,236 KB
testcase_25 AC 10 ms
11,216 KB
testcase_26 AC 2 ms
7,176 KB
testcase_27 AC 2 ms
7,104 KB
testcase_28 AC 2 ms
7,008 KB
testcase_29 AC 222 ms
12,584 KB
testcase_30 AC 62 ms
11,516 KB
testcase_31 AC 2 ms
7,100 KB
testcase_32 AC 3 ms
7,064 KB
testcase_33 AC 3 ms
7,128 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 Data.List

sumCheck :: Int -> [Int] -> [Int]                                           
sumCheck n xs = if n < (sum xs)
                     then sumCheck n (take (length(xs) - 1) xs)
                     else xs

solve :: [Int] -> Int
solve (l:_:xs) = length $ sumCheck l (sort xs)

main :: IO ()
main = interact $ show . solve . map read . words
0