結果

問題 No.406 鴨等間隔の法則
ユーザー minezumuminezumu
提出日時 2018-07-23 15:02:03
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 327 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,708 KB
実行使用メモリ 18,912 KB
最終ジャッジ日時 2023-09-21 18:52:46
合計ジャッジ時間 3,583 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
12,812 KB
testcase_01 AC 15 ms
7,808 KB
testcase_02 AC 16 ms
7,728 KB
testcase_03 AC 16 ms
7,856 KB
testcase_04 AC 108 ms
17,832 KB
testcase_05 AC 47 ms
12,652 KB
testcase_06 AC 49 ms
12,332 KB
testcase_07 AC 50 ms
12,372 KB
testcase_08 AC 106 ms
18,428 KB
testcase_09 AC 119 ms
18,796 KB
testcase_10 AC 54 ms
12,856 KB
testcase_11 AC 92 ms
16,412 KB
testcase_12 AC 68 ms
13,360 KB
testcase_13 AC 60 ms
12,960 KB
testcase_14 AC 100 ms
17,180 KB
testcase_15 AC 17 ms
8,688 KB
testcase_16 AC 21 ms
8,784 KB
testcase_17 AC 18 ms
8,440 KB
testcase_18 AC 21 ms
8,688 KB
testcase_19 AC 22 ms
9,036 KB
testcase_20 AC 26 ms
9,464 KB
testcase_21 AC 27 ms
9,804 KB
testcase_22 AC 36 ms
10,620 KB
testcase_23 AC 68 ms
13,724 KB
testcase_24 AC 84 ms
15,920 KB
testcase_25 AC 118 ms
18,732 KB
testcase_26 AC 117 ms
18,856 KB
testcase_27 AC 66 ms
18,812 KB
testcase_28 AC 93 ms
18,884 KB
testcase_29 AC 111 ms
18,912 KB
testcase_30 AC 112 ms
18,876 KB
testcase_31 AC 114 ms
18,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
X = list(map(int,input().split()))
X = sorted(X)
D = []
counter = 0
for i in range(N-1) :
    if X[i+1] - X[i] != 0 :
        d = X[i+1] - X[i]
        D.append(d)

if len(D) != 0 :
    checker = D[0]
    if N-1 == D.count(checker) :
        print("YES")
    else :
        print("NO")
else :
    print("NO")

0