結果

問題 No.45 回転寿司
ユーザー aimyaimy
提出日時 2017-04-26 09:06:17
言語 Haskell
(9.8.2)
結果
TLE  
実行時間 -
コード長 295 bytes
コンパイル時間 1,467 ms
コンパイル使用メモリ 165,920 KB
実行使用メモリ 24,136 KB
最終ジャッジ日時 2023-10-11 15:08:12
合計ジャッジ時間 50,555 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 692 ms
15,608 KB
testcase_01 AC 1,633 ms
19,032 KB
testcase_02 AC 3,401 ms
21,064 KB
testcase_03 AC 4,373 ms
22,124 KB
testcase_04 AC 1,802 ms
18,996 KB
testcase_05 AC 42 ms
12,520 KB
testcase_06 AC 1,162 ms
16,560 KB
testcase_07 AC 3,431 ms
21,052 KB
testcase_08 AC 272 ms
14,544 KB
testcase_09 AC 4,212 ms
22,252 KB
testcase_10 AC 742 ms
15,620 KB
testcase_11 AC 182 ms
13,616 KB
testcase_12 AC 3,742 ms
21,020 KB
testcase_13 AC 33 ms
12,472 KB
testcase_14 AC 21 ms
12,200 KB
testcase_15 AC 922 ms
16,016 KB
testcase_16 AC 362 ms
15,668 KB
testcase_17 AC 682 ms
15,648 KB
testcase_18 AC 383 ms
15,684 KB
testcase_19 AC 2,752 ms
20,088 KB
testcase_20 AC 22 ms
12,100 KB
testcase_21 AC 32 ms
12,440 KB
testcase_22 AC 3 ms
7,544 KB
testcase_23 AC 3 ms
7,572 KB
testcase_24 AC 2 ms
7,504 KB
testcase_25 AC 3 ms
7,484 KB
testcase_26 AC 962 ms
16,600 KB
testcase_27 AC 2,573 ms
19,068 KB
testcase_28 AC 1,102 ms
16,668 KB
testcase_29 AC 2,203 ms
20,032 KB
testcase_30 AC 2,282 ms
20,020 KB
testcase_31 AC 2 ms
7,588 KB
testcase_32 AC 2 ms
7,588 KB
testcase_33 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 qualified Data.IntMap as M
import Data.List

main = getContents >>= print . sushi . map read . tail . words

sushi = fst . M.findMax . foldl' dp (M.singleton 0 True)

dp im v = M.unionWith (||) (M.map (const True) im) im'
 where im' = M.map (const False) $ M.mapKeys (+v) (M.filter id im)
0