結果

問題 No.406 鴨等間隔の法則
ユーザー Naoki_M_Naoki_M_
提出日時 2016-08-13 13:26:34
言語 Haskell
(9.8.2)
結果
AC  
実行時間 243 ms / 2,000 ms
コード長 321 bytes
コンパイル時間 1,055 ms
コンパイル使用メモリ 164,964 KB
実行使用メモリ 30,528 KB
最終ジャッジ日時 2023-09-21 18:01:15
合計ジャッジ時間 6,340 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
17,312 KB
testcase_01 AC 2 ms
7,148 KB
testcase_02 AC 2 ms
7,192 KB
testcase_03 AC 2 ms
7,232 KB
testcase_04 AC 192 ms
27,872 KB
testcase_05 AC 63 ms
16,636 KB
testcase_06 AC 62 ms
16,816 KB
testcase_07 AC 62 ms
16,872 KB
testcase_08 AC 202 ms
27,952 KB
testcase_09 AC 232 ms
30,528 KB
testcase_10 AC 72 ms
17,376 KB
testcase_11 AC 163 ms
24,908 KB
testcase_12 AC 92 ms
19,704 KB
testcase_13 AC 82 ms
18,224 KB
testcase_14 AC 183 ms
26,676 KB
testcase_15 AC 5 ms
9,732 KB
testcase_16 AC 12 ms
12,008 KB
testcase_17 AC 12 ms
11,228 KB
testcase_18 AC 6 ms
10,636 KB
testcase_19 AC 23 ms
12,244 KB
testcase_20 AC 22 ms
12,600 KB
testcase_21 AC 22 ms
12,860 KB
testcase_22 AC 42 ms
14,248 KB
testcase_23 AC 102 ms
20,320 KB
testcase_24 AC 162 ms
24,308 KB
testcase_25 AC 242 ms
29,980 KB
testcase_26 AC 233 ms
29,916 KB
testcase_27 AC 42 ms
24,916 KB
testcase_28 AC 52 ms
25,968 KB
testcase_29 AC 243 ms
29,904 KB
testcase_30 AC 243 ms
30,248 KB
testcase_31 AC 223 ms
29,396 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 qualified Data.ByteString.Char8 as BS
import Data.List
import Data.Maybe

main = BS.getContents >>= putStrLn . solve [] . sort . map (fst . fromJust . BS.readInt) . tail . BS.words

solve ls [_] = if head ls /= 0 && all (== head ls) (tail ls) then "YES" else "NO"
solve ls (a0:a1:as) = solve ((a0 - a1):ls) (a1:as)
0