結果
問題 |
No.45 回転寿司
|
ユーザー |
|
提出日時 | 2020-05-26 17:58:23 |
言語 | Haskell (9.10.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 383 bytes |
コンパイル時間 | 1,430 ms |
コンパイル使用メモリ | 178,304 KB |
実行使用メモリ | 8,064 KB |
最終ジャッジ日時 | 2024-10-13 02:48:08 |
合計ジャッジ時間 | 2,434 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 23 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
ソースコード
main :: IO () main = do _n <- getLine getLine >>= print . solve . map read . words solve :: [Int] -> Int solve v = solve' v ((0, 0), (0, 0), (0, 0)) where solve' :: [Int] -> ((Int, Int), (Int, Int), (Int, Int)) -> Int solve' [] (_, _, (e, f)) = max e f solve' (h:t) ((a, b), (c, d), e) = solve' t ((c, d), e, (h + max c d, h + max a b))