結果

問題 No.406 鴨等間隔の法則
ユーザー SamuSoftSamuSoft
提出日時 2016-10-07 18:59:12
言語 Haskell
(9.8.2)
結果
AC  
実行時間 382 ms / 2,000 ms
コード長 321 bytes
コンパイル時間 3,082 ms
コンパイル使用メモリ 166,304 KB
実行使用メモリ 31,500 KB
最終ジャッジ日時 2023-09-21 18:14:56
合計ジャッジ時間 10,549 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
17,964 KB
testcase_01 AC 3 ms
7,244 KB
testcase_02 AC 2 ms
7,300 KB
testcase_03 AC 3 ms
7,256 KB
testcase_04 AC 332 ms
28,528 KB
testcase_05 AC 112 ms
16,792 KB
testcase_06 AC 113 ms
16,936 KB
testcase_07 AC 112 ms
17,612 KB
testcase_08 AC 332 ms
28,524 KB
testcase_09 AC 372 ms
31,500 KB
testcase_10 AC 132 ms
18,140 KB
testcase_11 AC 263 ms
25,844 KB
testcase_12 AC 173 ms
20,420 KB
testcase_13 AC 163 ms
21,700 KB
testcase_14 AC 302 ms
27,164 KB
testcase_15 AC 22 ms
12,036 KB
testcase_16 AC 32 ms
13,112 KB
testcase_17 AC 23 ms
12,140 KB
testcase_18 AC 22 ms
11,744 KB
testcase_19 AC 32 ms
13,572 KB
testcase_20 AC 42 ms
14,036 KB
testcase_21 AC 42 ms
14,052 KB
testcase_22 AC 73 ms
16,796 KB
testcase_23 AC 182 ms
21,540 KB
testcase_24 AC 252 ms
25,036 KB
testcase_25 AC 373 ms
31,376 KB
testcase_26 AC 372 ms
30,932 KB
testcase_27 AC 192 ms
20,076 KB
testcase_28 AC 213 ms
26,784 KB
testcase_29 AC 382 ms
30,644 KB
testcase_30 AC 373 ms
30,776 KB
testcase_31 AC 362 ms
30,292 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 )
[2 of 2] Linking a.out

ソースコード

diff #

import Data.List(sort)

main :: IO ()
main = getContents >>= putStrLn . checkList [] . sort . tail . map readInt . words

readInt :: String -> Int
readInt = read

checkList :: [Int] -> [Int] -> String
checkList (x:xs) [_] = if x /= 0 && all (x==) xs then "YES" else "NO"
checkList cs (x:y:xs) = checkList (y-x:cs) (y:xs)
0