結果

問題 No.406 鴨等間隔の法則
ユーザー iad_2889iad_2889
提出日時 2019-04-29 12:44:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 391 bytes
コンパイル時間 230 ms
コンパイル使用メモリ 10,808 KB
実行使用メモリ 21,584 KB
最終ジャッジ日時 2023-09-21 19:01:54
合計ジャッジ時間 3,371 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
14,996 KB
testcase_01 AC 16 ms
7,904 KB
testcase_02 AC 16 ms
7,796 KB
testcase_03 AC 16 ms
7,756 KB
testcase_04 AC 83 ms
21,072 KB
testcase_05 AC 39 ms
14,288 KB
testcase_06 AC 41 ms
14,628 KB
testcase_07 AC 41 ms
14,648 KB
testcase_08 AC 83 ms
21,584 KB
testcase_09 AC 90 ms
21,004 KB
testcase_10 AC 44 ms
15,052 KB
testcase_11 AC 68 ms
17,164 KB
testcase_12 AC 50 ms
15,116 KB
testcase_13 AC 49 ms
14,544 KB
testcase_14 AC 93 ms
20,208 KB
testcase_15 AC 18 ms
8,892 KB
testcase_16 AC 20 ms
9,528 KB
testcase_17 AC 18 ms
8,848 KB
testcase_18 AC 19 ms
9,632 KB
testcase_19 AC 22 ms
9,660 KB
testcase_20 AC 25 ms
9,992 KB
testcase_21 AC 24 ms
10,020 KB
testcase_22 AC 35 ms
13,124 KB
testcase_23 AC 52 ms
15,412 KB
testcase_24 AC 77 ms
16,600 KB
testcase_25 AC 90 ms
21,064 KB
testcase_26 AC 107 ms
21,124 KB
testcase_27 AC 54 ms
18,928 KB
testcase_28 AC 66 ms
21,116 KB
testcase_29 AC 112 ms
21,228 KB
testcase_30 AC 111 ms
20,948 KB
testcase_31 AC 88 ms
20,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def eql_space(xs:list):
    space = abs(xs[0] - xs[1])
    check = lambda x,y:abs(x - y) == space
    xlen = len(xs)
    if len(list(set(xs))) != xlen:
        return False
    for i in range(1,xlen - 1):
        if not check(xs[i],xs[i + 1]):
            return False
    return True

N = int(input())
xs = [int(x) for x in input().split()]
xs.sort()
print("YES" if eql_space(xs) else "NO")
0