結果
問題 |
No.45 回転寿司
|
ユーザー |
|
提出日時 | 2020-05-26 15:55:30 |
言語 | Haskell (9.10.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 378 bytes |
コンパイル時間 | 8,871 ms |
コンパイル使用メモリ | 172,032 KB |
実行使用メモリ | 16,288 KB |
最終ジャッジ日時 | 2024-10-13 02:44:54 |
合計ジャッジ時間 | 18,011 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 4 |
other | TLE * 1 -- * 29 |
コンパイルメッセージ
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
ソースコード
main :: IO () main = do _n <- getLine getLine >>= print . solve . map read . words solve :: [Int] -> Int solve = maximum . map sum . genLists where genLists :: [Int] -> [[Int]] genLists [] = [[]] genLists [a] = [[a]] genLists [a, b] = [[a], [b]] genLists (a:b:c:d) = [ a:i | i <- genLists (c:d) ] ++ [ b:i | i <- genLists d ]