結果

問題 No.406 鴨等間隔の法則
ユーザー JohnnyJohnny
提出日時 2017-02-11 18:47:01
言語 Haskell
(9.8.2)
結果
WA  
実行時間 -
コード長 271 bytes
コンパイル時間 11,502 ms
コンパイル使用メモリ 173,696 KB
実行使用メモリ 44,800 KB
最終ジャッジ日時 2024-04-25 00:48:11
合計ジャッジ時間 19,201 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
22,144 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 2 ms
5,248 KB
testcase_03 WA -
testcase_04 AC 285 ms
35,584 KB
testcase_05 AC 106 ms
21,120 KB
testcase_06 AC 108 ms
21,120 KB
testcase_07 AC 109 ms
21,120 KB
testcase_08 AC 293 ms
35,328 KB
testcase_09 AC 333 ms
41,856 KB
testcase_10 AC 130 ms
22,144 KB
testcase_11 AC 251 ms
35,328 KB
testcase_12 AC 188 ms
29,184 KB
testcase_13 AC 185 ms
27,520 KB
testcase_14 AC 426 ms
37,376 KB
testcase_15 WA -
testcase_16 AC 25 ms
10,752 KB
testcase_17 AC 15 ms
9,088 KB
testcase_18 AC 27 ms
10,880 KB
testcase_19 AC 45 ms
11,648 KB
testcase_20 AC 58 ms
13,952 KB
testcase_21 AC 43 ms
13,824 KB
testcase_22 AC 106 ms
18,432 KB
testcase_23 AC 196 ms
31,360 KB
testcase_24 AC 399 ms
37,376 KB
testcase_25 AC 329 ms
43,008 KB
testcase_26 AC 522 ms
44,800 KB
testcase_27 WA -
testcase_28 AC 309 ms
41,088 KB
testcase_29 AC 540 ms
44,800 KB
testcase_30 AC 527 ms
42,624 KB
testcase_31 AC 322 ms
38,528 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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:6:1: warning: [GHC-94817] [-Wtabs]
    Tab character found here, and in 9 further locations.
    Suggested fix: Please use spaces instead.
  |
6 |         where
  | ^^^^^^^^
[2 of 2] Linking a.out

ソースコード

diff #

import Control.Applicative
import Data.List

f 2 _ = "YES"
f n (x:xs) = if (x2 - x1) == (x3 - x2) then f (n-1) xs else "NO"
	where
		x1 = x
		x2 = xs !! 0
		x3 = xs !! 1

main = do
  	n <- getLine
  	xs <- (map read . words) <$> getLine
  	putStrLn $ f (read n) (sort xs)
0