結果

問題 No.406 鴨等間隔の法則
ユーザー HagianHagian
提出日時 2021-06-21 16:25:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 1,185 ms
コンパイル使用メモリ 10,712 KB
実行使用メモリ 21,828 KB
最終ジャッジ日時 2023-09-05 01:53:43
合計ジャッジ時間 5,482 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
15,152 KB
testcase_01 AC 15 ms
7,800 KB
testcase_02 AC 16 ms
7,800 KB
testcase_03 AC 15 ms
7,800 KB
testcase_04 AC 79 ms
21,096 KB
testcase_05 AC 38 ms
14,224 KB
testcase_06 AC 39 ms
14,624 KB
testcase_07 AC 38 ms
14,640 KB
testcase_08 AC 77 ms
21,828 KB
testcase_09 AC 83 ms
21,116 KB
testcase_10 AC 42 ms
15,200 KB
testcase_11 AC 63 ms
16,492 KB
testcase_12 AC 48 ms
15,112 KB
testcase_13 AC 45 ms
14,772 KB
testcase_14 AC 93 ms
20,240 KB
testcase_15 AC 18 ms
8,896 KB
testcase_16 AC 20 ms
9,672 KB
testcase_17 AC 18 ms
8,808 KB
testcase_18 AC 19 ms
9,640 KB
testcase_19 AC 22 ms
9,568 KB
testcase_20 AC 25 ms
10,036 KB
testcase_21 AC 23 ms
10,124 KB
testcase_22 AC 36 ms
12,888 KB
testcase_23 AC 49 ms
15,532 KB
testcase_24 AC 81 ms
16,424 KB
testcase_25 AC 84 ms
21,212 KB
testcase_26 AC 105 ms
21,192 KB
testcase_27 AC 52 ms
19,180 KB
testcase_28 AC 60 ms
21,108 KB
testcase_29 AC 113 ms
21,364 KB
testcase_30 AC 111 ms
20,972 KB
testcase_31 AC 82 ms
20,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
x = [int(i) for i in input().split()]
x.sort()
res = x[1] - x[0]
if len(x) == len(set(x)):
    for i in range(2,len(x)):
        a = x[i] - x[i-1]
        if a != res:
            res = -1
            break
        else:
            pass
    if res == -1:
        print("NO")
    else:
        print("YES")
else:
    print("NO")
0