結果

問題 No.406 鴨等間隔の法則
ユーザー nasubi24nasubi24
提出日時 2020-11-02 19:05:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 232 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,528 KB
実行使用メモリ 19,116 KB
最終ジャッジ日時 2023-09-29 12:15:53
合計ジャッジ時間 2,910 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
12,556 KB
testcase_01 AC 15 ms
7,932 KB
testcase_02 AC 15 ms
7,968 KB
testcase_03 AC 15 ms
7,848 KB
testcase_04 AC 61 ms
17,992 KB
testcase_05 AC 32 ms
11,580 KB
testcase_06 AC 32 ms
11,984 KB
testcase_07 AC 33 ms
12,080 KB
testcase_08 AC 64 ms
18,500 KB
testcase_09 AC 67 ms
18,736 KB
testcase_10 AC 36 ms
12,332 KB
testcase_11 AC 55 ms
16,504 KB
testcase_12 AC 40 ms
13,552 KB
testcase_13 AC 38 ms
13,096 KB
testcase_14 AC 76 ms
17,100 KB
testcase_15 AC 18 ms
8,736 KB
testcase_16 AC 17 ms
9,000 KB
testcase_17 AC 16 ms
8,624 KB
testcase_18 AC 16 ms
8,720 KB
testcase_19 AC 20 ms
9,028 KB
testcase_20 AC 22 ms
9,364 KB
testcase_21 AC 20 ms
9,468 KB
testcase_22 AC 30 ms
10,436 KB
testcase_23 AC 41 ms
13,832 KB
testcase_24 AC 67 ms
15,940 KB
testcase_25 AC 66 ms
18,812 KB
testcase_26 AC 88 ms
19,116 KB
testcase_27 AC 65 ms
19,012 KB
testcase_28 AC 47 ms
18,944 KB
testcase_29 AC 89 ms
19,008 KB
testcase_30 AC 88 ms
18,820 KB
testcase_31 AC 63 ms
18,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
x=list(map(int,input().split()))
x.sort()
num=x[1]-x[0]
ans=0
for i in range(1,n-1):
    if x[i+1]-x[i]!=num:
        ans=1
        break
if num==0:
    print("NO")
elif ans==0:
    print("YES")
else:
    print("NO")
0