結果
問題 | No.358 も~っと!門松列 |
ユーザー |
![]() |
提出日時 | 2016-04-18 14:17:30 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 413 bytes |
コンパイル時間 | 3,163 ms |
コンパイル使用メモリ | 174,464 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-04 13:30:07 |
合計ジャッジ時間 | 2,370 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
コンパイルメッセージ
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
ソースコード
import Control.Monadimport Data.Listimport Control.Applicativeanswer True = "YES"answer False = "NO"is_kado [a,b,c] = (a /= b && b /= c && a /= c) && ((a < b && b > c) || (a > b && b < c))bti True = 1bti _ = 0main = doxs <- fmap (read :: String -> Int) . words <$> getLineif is_kado xsthen putStrLn "INF"else print $ sum $ map (\x -> bti $ is_kado (map (\a -> a `mod` x) xs)) [1..1000]