結果
問題 |
No.45 回転寿司
|
ユーザー |
![]() |
提出日時 | 2018-05-18 11:54:12 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 6 ms / 5,000 ms |
コード長 | 237 bytes |
コンパイル時間 | 9,766 ms |
コンパイル使用メモリ | 171,904 KB |
実行使用メモリ | 7,808 KB |
最終ジャッジ日時 | 2024-12-27 18:55:44 |
合計ジャッジ時間 | 10,932 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
コンパイルメッセージ
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 = do n <- readLn :: IO Int vs <- (map read . words) <$> getLine putStrLn . show $ resolve vs resolve vs = resolve' vs 0 0 0 where resolve' [] a b c = max b c resolve' (n:ns) a b c = resolve' ns b c (max (a+n) (b+n))