結果
問題 | No.116 門松列(1) |
ユーザー |
|
提出日時 | 2018-01-06 21:23:28 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 402 bytes |
コンパイル時間 | 6,467 ms |
コンパイル使用メモリ | 170,624 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-25 01:36:00 |
合計ジャッジ時間 | 6,718 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
コンパイルメッセージ
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
ソースコード
importControl.Applicative(<$>)importControl.MonadimportData.Listmain::IO()main = dogetLinesolve <$> getl (map read . words) >>= printsolve::Int->Intsolve = f 0wheref c (x:y:z:zs) | ((y > x && y > z) || (y < x && y < z)) && x /= z = f (c + 1) (y:z:zs)| otherwise = f c (y:z:zs)f c _ = cgetl::String->a->IOagetl f = f <$> getLine