結果

問題 No.395 永遠の17歳
ユーザー Haar
提出日時 2016-08-22 07:45:27
言語 Haskell
(9.10.1)
結果
WA  
実行時間 -
コード長 325 bytes
コンパイル時間 2,082 ms
コンパイル使用メモリ 174,208 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 22:33:49
合計ジャッジ時間 2,991 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15 WA * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )

Main.hs:4:1: warning: [GHC-94817] [-Wtabs]
    Tab character found here, and in 29 further locations.
    Suggested fix: Please use spaces instead.
  |
4 |         a <- readLn
  | ^^^^^^^^
[2 of 2] Linking a.out

ソースコード

diff #

import Control.Applicative

main = do
	a <- readLn
	print $ maybe $ foldl1 func $ map (func2 a) [2..100]
		where
			Nothing `func` Nothing = Nothing
			Nothing `func` (Just x) = Just x
			(Just x) `func` _ = Just x
			func2 a x
				| (x + 7) == a = Just x
				| otherwise = Nothing
			maybe (Just x) = x
			maybe Nothing = -1
0