結果

問題 No.406 鴨等間隔の法則
ユーザー LeonardoneLeonardone
提出日時 2016-08-09 06:33:42
言語 Haskell
(9.8.2)
結果
AC  
実行時間 362 ms / 2,000 ms
コード長 336 bytes
コンパイル時間 4,482 ms
コンパイル使用メモリ 167,180 KB
実行使用メモリ 27,860 KB
最終ジャッジ日時 2023-09-21 17:59:41
合計ジャッジ時間 11,357 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
16,624 KB
testcase_01 AC 3 ms
7,184 KB
testcase_02 AC 2 ms
7,268 KB
testcase_03 AC 2 ms
7,348 KB
testcase_04 AC 322 ms
25,472 KB
testcase_05 AC 112 ms
16,204 KB
testcase_06 AC 112 ms
16,100 KB
testcase_07 AC 122 ms
17,384 KB
testcase_08 AC 322 ms
26,468 KB
testcase_09 AC 352 ms
26,652 KB
testcase_10 AC 132 ms
17,672 KB
testcase_11 AC 262 ms
23,776 KB
testcase_12 AC 162 ms
20,400 KB
testcase_13 AC 162 ms
19,580 KB
testcase_14 AC 283 ms
23,564 KB
testcase_15 AC 22 ms
11,776 KB
testcase_16 AC 32 ms
13,120 KB
testcase_17 AC 22 ms
12,088 KB
testcase_18 AC 32 ms
12,464 KB
testcase_19 AC 32 ms
13,404 KB
testcase_20 AC 42 ms
14,096 KB
testcase_21 AC 52 ms
13,964 KB
testcase_22 AC 72 ms
15,236 KB
testcase_23 AC 182 ms
19,200 KB
testcase_24 AC 243 ms
22,528 KB
testcase_25 AC 362 ms
27,860 KB
testcase_26 AC 352 ms
26,776 KB
testcase_27 AC 202 ms
24,724 KB
testcase_28 AC 222 ms
24,796 KB
testcase_29 AC 342 ms
26,696 KB
testcase_30 AC 342 ms
26,652 KB
testcase_31 AC 342 ms
26,640 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 #

-- yukicoder My Practice
-- author: Leonardone @ NEETSDKASU

import Data.List (sort)

main = putStrLn . solve . sort . map read . tail . words =<< getContents

solve xs = ans where
    ys = sort . map (\(a, b) -> a - b) $ tail xs `zip` xs
    hd = head ys
    ed = head $ reverse ys
    ans = if hd > 0 && hd == ed then "YES" else "NO"
0