結果

問題 No.365 ジェンガソート
ユーザー aimyaimy
提出日時 2017-04-29 13:39:08
言語 Haskell
(9.8.2)
結果
AC  
実行時間 263 ms / 2,000 ms
コード長 245 bytes
コンパイル時間 1,017 ms
コンパイル使用メモリ 160,228 KB
実行使用メモリ 48,092 KB
最終ジャッジ日時 2023-10-11 20:23:15
合計ジャッジ時間 7,077 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,932 KB
testcase_01 AC 2 ms
6,916 KB
testcase_02 AC 2 ms
6,856 KB
testcase_03 AC 2 ms
6,828 KB
testcase_04 AC 2 ms
6,928 KB
testcase_05 AC 2 ms
6,912 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 3 ms
6,844 KB
testcase_08 AC 2 ms
6,860 KB
testcase_09 AC 3 ms
6,888 KB
testcase_10 AC 2 ms
6,860 KB
testcase_11 AC 3 ms
6,968 KB
testcase_12 AC 3 ms
6,952 KB
testcase_13 AC 2 ms
7,064 KB
testcase_14 AC 2 ms
7,100 KB
testcase_15 AC 3 ms
7,256 KB
testcase_16 AC 202 ms
32,788 KB
testcase_17 AC 243 ms
46,148 KB
testcase_18 AC 22 ms
13,020 KB
testcase_19 AC 243 ms
45,892 KB
testcase_20 AC 83 ms
21,008 KB
testcase_21 AC 63 ms
16,168 KB
testcase_22 AC 192 ms
31,716 KB
testcase_23 AC 112 ms
26,036 KB
testcase_24 AC 182 ms
31,808 KB
testcase_25 AC 52 ms
16,652 KB
testcase_26 AC 142 ms
28,748 KB
testcase_27 AC 252 ms
47,360 KB
testcase_28 AC 142 ms
28,956 KB
testcase_29 AC 232 ms
44,328 KB
testcase_30 AC 152 ms
28,972 KB
testcase_31 AC 73 ms
18,652 KB
testcase_32 AC 63 ms
17,348 KB
testcase_33 AC 252 ms
46,848 KB
testcase_34 AC 42 ms
15,180 KB
testcase_35 AC 193 ms
31,760 KB
testcase_36 AC 262 ms
47,940 KB
testcase_37 AC 262 ms
47,876 KB
testcase_38 AC 262 ms
47,952 KB
testcase_39 AC 262 ms
47,932 KB
testcase_40 AC 263 ms
48,092 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

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

jenga :: Int -> [Int] -> Int
jenga n as = n - length (ndsc as) + 1
 where ndsc = foldr (\x (a:acc) -> if x == pred a then x:a:acc else a:acc) [n+1]
0