結果

問題 No.406 鴨等間隔の法則
ユーザー torus711torus711
提出日時 2016-08-05 22:32:45
言語 Haskell
(9.8.2)
結果
AC  
実行時間 213 ms / 2,000 ms
コード長 701 bytes
コンパイル時間 1,661 ms
コンパイル使用メモリ 159,340 KB
実行使用メモリ 26,852 KB
最終ジャッジ日時 2023-09-21 17:46:21
合計ジャッジ時間 4,121 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
14,388 KB
testcase_01 AC 2 ms
7,168 KB
testcase_02 AC 2 ms
7,144 KB
testcase_03 AC 3 ms
7,164 KB
testcase_04 AC 43 ms
19,456 KB
testcase_05 AC 22 ms
13,516 KB
testcase_06 AC 22 ms
14,392 KB
testcase_07 AC 22 ms
13,524 KB
testcase_08 AC 43 ms
19,424 KB
testcase_09 AC 43 ms
19,708 KB
testcase_10 AC 22 ms
14,396 KB
testcase_11 AC 33 ms
15,596 KB
testcase_12 AC 22 ms
13,580 KB
testcase_13 AC 22 ms
13,708 KB
testcase_14 AC 153 ms
21,828 KB
testcase_15 AC 5 ms
9,036 KB
testcase_16 AC 6 ms
9,844 KB
testcase_17 AC 4 ms
8,544 KB
testcase_18 AC 5 ms
9,672 KB
testcase_19 AC 12 ms
11,760 KB
testcase_20 AC 22 ms
12,492 KB
testcase_21 AC 12 ms
12,004 KB
testcase_22 AC 32 ms
13,476 KB
testcase_23 AC 22 ms
14,728 KB
testcase_24 AC 132 ms
19,628 KB
testcase_25 AC 42 ms
19,784 KB
testcase_26 AC 212 ms
25,840 KB
testcase_27 AC 33 ms
19,932 KB
testcase_28 AC 32 ms
19,532 KB
testcase_29 AC 213 ms
26,852 KB
testcase_30 AC 203 ms
25,960 KB
testcase_31 AC 42 ms
19,532 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )

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

ソースコード

diff #

{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}

import Control.Applicative
import Control.Monad
import Control.Arrow
import Data.List
import Data.Maybe
import Data.Char
import qualified Data.ByteString.Char8 as B
import Text.Printf

readInt = ( readLn :: IO Int )
readInts = map ( read :: String -> Int ) . words <$> getLine

getList = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = getLine >> getList >>= putStrLn . which "YES" "NO" . f . sort

f ( a : b : l ) = f' ( b - a ) ( b : l )
	where
		f' 0 _ = False
		f' d ( a : b : l )
			| b - a /= d = False
			| otherwise = f' d ( b : l )
		f' _ _ = True
0