結果

問題 No.406 鴨等間隔の法則
ユーザー HaarHaar
提出日時 2016-08-31 19:46:25
言語 Haskell
(9.8.2)
結果
AC  
実行時間 493 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 818 ms
コンパイル使用メモリ 164,820 KB
実行使用メモリ 47,396 KB
最終ジャッジ日時 2023-09-21 18:06:02
合計ジャッジ時間 10,147 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
25,132 KB
testcase_01 AC 2 ms
7,232 KB
testcase_02 AC 3 ms
7,304 KB
testcase_03 AC 2 ms
7,320 KB
testcase_04 AC 272 ms
37,924 KB
testcase_05 AC 103 ms
24,196 KB
testcase_06 AC 102 ms
24,096 KB
testcase_07 AC 112 ms
24,008 KB
testcase_08 AC 263 ms
38,016 KB
testcase_09 AC 302 ms
44,816 KB
testcase_10 AC 122 ms
25,220 KB
testcase_11 AC 242 ms
38,016 KB
testcase_12 AC 172 ms
32,112 KB
testcase_13 AC 153 ms
31,016 KB
testcase_14 AC 372 ms
40,456 KB
testcase_15 AC 22 ms
13,576 KB
testcase_16 AC 33 ms
14,304 KB
testcase_17 AC 23 ms
12,600 KB
testcase_18 AC 32 ms
14,424 KB
testcase_19 AC 42 ms
15,320 KB
testcase_20 AC 53 ms
16,432 KB
testcase_21 AC 42 ms
17,028 KB
testcase_22 AC 92 ms
21,016 KB
testcase_23 AC 172 ms
33,316 KB
testcase_24 AC 332 ms
38,884 KB
testcase_25 AC 322 ms
46,368 KB
testcase_26 AC 482 ms
47,296 KB
testcase_27 AC 313 ms
45,296 KB
testcase_28 AC 302 ms
44,260 KB
testcase_29 AC 493 ms
47,396 KB
testcase_30 AC 472 ms
45,288 KB
testcase_31 AC 292 ms
41,480 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:10:1: warning: [GHC-94817] [-Wtabs]
    Tab character found here, and in 9 further locations.
    Suggested fix: Please use spaces instead.
   |
10 |            func (x:y:xs) = (y-x):(func(y:xs))
   | ^^^^^^^^
[2 of 2] Linking a.out

ソースコード

diff #

import Control.Applicative
import Data.List

main :: IO()
main = do
     getLine
     x <- sort . map (read::String->Int) . words <$> getLine
     putStrLn $ check $ func x
     where
	   func (x:y:xs) = (y-x):(func(y:xs))
	   func (x:[]) = []
	   check (x:y:xs)
	   	 | x == 0 = "NO"
		 | x == y = check (y:xs)
		 | otherwise = "NO"
	   check (x:[]) = "YES"
0