結果
問題 |
No.5 数字のブロック
|
ユーザー |
![]() |
提出日時 | 2017-05-04 16:39:07 |
言語 | Haskell (9.10.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 298 bytes |
コンパイル時間 | 1,656 ms |
コンパイル使用メモリ | 170,624 KB |
実行使用メモリ | 10,240 KB |
最終ジャッジ日時 | 2024-09-14 07:08:52 |
合計ジャッジ時間 | 3,033 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 WA * 7 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
import Prelude import Data.List (sort, inits) main :: IO () main = do l <- read <$> getLine _ <- getLine ws <- map read . words <$> getLine print $ calc l ws calc :: Int -> [Int] -> Int calc l ws = let ws' = sort ws in length $ takeWhile (l >) $ map sum $ drop 1 $ inits ws'