結果

問題 No.406 鴨等間隔の法則
ユーザー momen999momen999
提出日時 2019-03-11 23:09:11
言語 Haskell
(9.8.2)
結果
AC  
実行時間 513 ms / 2,000 ms
コード長 281 bytes
コンパイル時間 6,655 ms
コンパイル使用メモリ 158,640 KB
実行使用メモリ 47,380 KB
最終ジャッジ日時 2023-09-21 19:01:40
合計ジャッジ時間 14,948 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
25,064 KB
testcase_01 AC 2 ms
7,168 KB
testcase_02 AC 3 ms
7,208 KB
testcase_03 AC 2 ms
7,280 KB
testcase_04 AC 292 ms
37,980 KB
testcase_05 AC 123 ms
23,780 KB
testcase_06 AC 113 ms
23,980 KB
testcase_07 AC 113 ms
23,968 KB
testcase_08 AC 292 ms
38,000 KB
testcase_09 AC 322 ms
45,288 KB
testcase_10 AC 133 ms
25,112 KB
testcase_11 AC 262 ms
37,964 KB
testcase_12 AC 182 ms
31,968 KB
testcase_13 AC 153 ms
30,888 KB
testcase_14 AC 392 ms
40,616 KB
testcase_15 AC 22 ms
13,552 KB
testcase_16 AC 32 ms
14,400 KB
testcase_17 AC 22 ms
12,520 KB
testcase_18 AC 32 ms
14,476 KB
testcase_19 AC 42 ms
15,192 KB
testcase_20 AC 63 ms
16,800 KB
testcase_21 AC 53 ms
16,752 KB
testcase_22 AC 102 ms
22,132 KB
testcase_23 AC 182 ms
33,184 KB
testcase_24 AC 343 ms
40,972 KB
testcase_25 AC 323 ms
45,836 KB
testcase_26 AC 513 ms
47,288 KB
testcase_27 AC 312 ms
45,284 KB
testcase_28 AC 302 ms
43,996 KB
testcase_29 AC 502 ms
47,380 KB
testcase_30 AC 482 ms
45,380 KB
testcase_31 AC 302 ms
41,424 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

solve xs
    | any (== 0) xs'        = "NO"
    | all (== head xs') xs' = "YES"
    | otherwise             = "NO"
    where
        xs' = zipWith (-) (tail xs) (init xs)

main = do
    getLine
    xs <- sort . map read . words <$> getLine
    putStrLn $ solve xs
0