結果

問題 No.406 鴨等間隔の法則
ユーザー Naoki_M_Naoki_M_
提出日時 2016-08-13 13:15:53
言語 Haskell
(9.8.2)
結果
AC  
実行時間 363 ms / 2,000 ms
コード長 227 bytes
コンパイル時間 894 ms
コンパイル使用メモリ 158,088 KB
実行使用メモリ 31,948 KB
最終ジャッジ日時 2023-09-21 18:01:28
合計ジャッジ時間 7,474 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
17,456 KB
testcase_01 AC 2 ms
7,300 KB
testcase_02 AC 2 ms
7,216 KB
testcase_03 AC 2 ms
7,352 KB
testcase_04 AC 312 ms
28,152 KB
testcase_05 AC 102 ms
17,012 KB
testcase_06 AC 112 ms
16,948 KB
testcase_07 AC 112 ms
17,744 KB
testcase_08 AC 302 ms
28,516 KB
testcase_09 AC 342 ms
30,912 KB
testcase_10 AC 132 ms
18,736 KB
testcase_11 AC 252 ms
25,844 KB
testcase_12 AC 163 ms
20,448 KB
testcase_13 AC 153 ms
20,620 KB
testcase_14 AC 282 ms
27,528 KB
testcase_15 AC 21 ms
11,928 KB
testcase_16 AC 32 ms
12,976 KB
testcase_17 AC 22 ms
12,108 KB
testcase_18 AC 22 ms
11,720 KB
testcase_19 AC 32 ms
13,368 KB
testcase_20 AC 42 ms
14,048 KB
testcase_21 AC 42 ms
13,912 KB
testcase_22 AC 72 ms
15,848 KB
testcase_23 AC 172 ms
21,408 KB
testcase_24 AC 242 ms
24,540 KB
testcase_25 AC 353 ms
31,344 KB
testcase_26 AC 363 ms
31,948 KB
testcase_27 AC 192 ms
21,200 KB
testcase_28 AC 212 ms
25,736 KB
testcase_29 AC 352 ms
31,324 KB
testcase_30 AC 352 ms
31,080 KB
testcase_31 AC 332 ms
30,092 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

main = getContents >>= putStrLn . solve [] . sort . map read . tail . 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