結果

問題 No.406 鴨等間隔の法則
ユーザー lvs7klvs7k
提出日時 2018-09-12 22:31:37
言語 Haskell
(9.6.2)
結果
AC  
実行時間 453 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 721 ms
コンパイル使用メモリ 164,112 KB
実行使用メモリ 47,356 KB
最終ジャッジ日時 2023-09-21 18:53:36
合計ジャッジ時間 8,057 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
24,872 KB
testcase_01 AC 2 ms
7,152 KB
testcase_02 AC 3 ms
7,272 KB
testcase_03 AC 2 ms
7,160 KB
testcase_04 AC 272 ms
37,864 KB
testcase_05 AC 92 ms
22,896 KB
testcase_06 AC 102 ms
23,940 KB
testcase_07 AC 102 ms
23,900 KB
testcase_08 AC 263 ms
37,864 KB
testcase_09 AC 312 ms
45,236 KB
testcase_10 AC 122 ms
24,712 KB
testcase_11 AC 232 ms
37,868 KB
testcase_12 AC 162 ms
31,976 KB
testcase_13 AC 152 ms
30,364 KB
testcase_14 AC 352 ms
40,316 KB
testcase_15 AC 22 ms
13,460 KB
testcase_16 AC 32 ms
14,160 KB
testcase_17 AC 22 ms
12,420 KB
testcase_18 AC 32 ms
14,428 KB
testcase_19 AC 42 ms
15,144 KB
testcase_20 AC 52 ms
15,920 KB
testcase_21 AC 42 ms
16,828 KB
testcase_22 AC 92 ms
20,856 KB
testcase_23 AC 172 ms
33,972 KB
testcase_24 AC 312 ms
38,892 KB
testcase_25 AC 322 ms
46,168 KB
testcase_26 AC 453 ms
47,356 KB
testcase_27 AC 302 ms
45,240 KB
testcase_28 AC 292 ms
44,200 KB
testcase_29 AC 452 ms
47,232 KB
testcase_30 AC 433 ms
45,240 KB
testcase_31 AC 283 ms
41,324 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 #

module Main where

import Control.Monad
import Data.List (sort)

main :: IO ()
main = do
    getLine
    xs <- sort . fmap read . words <$> getLine :: IO [Int]
    let bs@(b:_) = zip xs (drop 1 xs)
    let space = uncurry (-) b
    if (space /= 0) && (all (== space) $ fmap (uncurry (-)) bs)
        then putStrLn "YES"
        else putStrLn "NO"
0