結果

問題 No.406 鴨等間隔の法則
ユーザー _KingdomOfMoray_KingdomOfMoray
提出日時 2019-12-07 10:17:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 328 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 19,060 KB
最終ジャッジ日時 2023-09-21 19:09:52
合計ジャッジ時間 2,829 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
12,568 KB
testcase_01 AC 14 ms
7,832 KB
testcase_02 AC 14 ms
7,860 KB
testcase_03 AC 14 ms
7,812 KB
testcase_04 AC 61 ms
17,916 KB
testcase_05 AC 30 ms
11,808 KB
testcase_06 AC 31 ms
11,944 KB
testcase_07 AC 31 ms
12,096 KB
testcase_08 AC 64 ms
18,512 KB
testcase_09 AC 65 ms
18,888 KB
testcase_10 AC 34 ms
12,616 KB
testcase_11 AC 51 ms
16,404 KB
testcase_12 AC 38 ms
13,564 KB
testcase_13 AC 37 ms
13,056 KB
testcase_14 AC 76 ms
17,228 KB
testcase_15 AC 16 ms
8,852 KB
testcase_16 AC 17 ms
9,048 KB
testcase_17 AC 16 ms
8,592 KB
testcase_18 AC 16 ms
8,868 KB
testcase_19 AC 20 ms
9,136 KB
testcase_20 AC 23 ms
9,408 KB
testcase_21 AC 20 ms
9,460 KB
testcase_22 AC 29 ms
10,564 KB
testcase_23 AC 40 ms
13,720 KB
testcase_24 AC 66 ms
15,864 KB
testcase_25 AC 65 ms
18,804 KB
testcase_26 AC 87 ms
19,060 KB
testcase_27 AC 44 ms
19,036 KB
testcase_28 AC 45 ms
18,896 KB
testcase_29 AC 86 ms
19,024 KB
testcase_30 AC 87 ms
18,776 KB
testcase_31 AC 63 ms
18,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
x = list(map(int,input().split()))

sorted_x = sorted(x)

delta = sorted_x[1] - sorted_x[0]

flag = 1

if delta == 0:
    flag = 0
else:
    for i in range(n-1):
        if delta != sorted_x[i+1] - sorted_x[i]:
            flag = 0
            break
        
if flag == 1:
    print('YES')
else:
    print('NO')
0