結果

問題 No.406 鴨等間隔の法則
ユーザー JohnnyJohnny
提出日時 2017-02-11 18:49:29
言語 Haskell
(9.8.2)
結果
AC  
実行時間 483 ms / 2,000 ms
コード長 293 bytes
コンパイル時間 2,248 ms
コンパイル使用メモリ 168,520 KB
実行使用メモリ 47,484 KB
最終ジャッジ日時 2023-09-21 18:22:59
合計ジャッジ時間 8,497 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
25,120 KB
testcase_01 AC 3 ms
7,244 KB
testcase_02 AC 3 ms
7,328 KB
testcase_03 AC 2 ms
7,280 KB
testcase_04 AC 272 ms
37,964 KB
testcase_05 AC 102 ms
23,832 KB
testcase_06 AC 102 ms
23,996 KB
testcase_07 AC 112 ms
23,968 KB
testcase_08 AC 263 ms
38,112 KB
testcase_09 AC 313 ms
45,376 KB
testcase_10 AC 122 ms
25,072 KB
testcase_11 AC 243 ms
38,036 KB
testcase_12 AC 163 ms
32,008 KB
testcase_13 AC 152 ms
30,428 KB
testcase_14 AC 362 ms
40,244 KB
testcase_15 AC 22 ms
13,608 KB
testcase_16 AC 32 ms
14,176 KB
testcase_17 AC 22 ms
12,560 KB
testcase_18 AC 32 ms
14,488 KB
testcase_19 AC 42 ms
15,244 KB
testcase_20 AC 53 ms
16,936 KB
testcase_21 AC 42 ms
16,856 KB
testcase_22 AC 92 ms
21,184 KB
testcase_23 AC 163 ms
33,572 KB
testcase_24 AC 322 ms
39,948 KB
testcase_25 AC 312 ms
45,860 KB
testcase_26 AC 483 ms
47,368 KB
testcase_27 AC 293 ms
45,292 KB
testcase_28 AC 292 ms
43,808 KB
testcase_29 AC 472 ms
47,484 KB
testcase_30 AC 453 ms
45,280 KB
testcase_31 AC 293 ms
41,476 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: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)) && ((x2 - x1) /= 0) 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