結果

問題 No.365 ジェンガソート
ユーザー aimyaimy
提出日時 2017-04-29 13:19:18
言語 Haskell
(9.8.2)
結果
WA  
実行時間 -
コード長 245 bytes
コンパイル時間 3,209 ms
コンパイル使用メモリ 159,424 KB
実行使用メモリ 36,296 KB
最終ジャッジ日時 2023-10-11 20:22:40
合計ジャッジ時間 8,082 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,940 KB
testcase_01 AC 3 ms
6,888 KB
testcase_02 AC 3 ms
6,880 KB
testcase_03 AC 2 ms
6,924 KB
testcase_04 AC 2 ms
6,956 KB
testcase_05 AC 3 ms
6,940 KB
testcase_06 AC 3 ms
6,936 KB
testcase_07 AC 3 ms
6,880 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 2 ms
6,948 KB
testcase_15 AC 3 ms
7,472 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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

main = do
 n <- readLn
 as <- map read . words <$> getLine
 print (jenga n as)

jenga n as = n - masc as
 where
  masc = maximum . map asc . tails
  asc = pred . length . foldl (\(a:acc) x -> if a<x then x:a:acc else a:acc) [0]
0