結果

問題 No.406 鴨等間隔の法則
ユーザー knt3110knt3110
提出日時 2018-05-14 23:47:45
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 226 bytes
コンパイル時間 347 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 19,036 KB
最終ジャッジ日時 2023-09-21 18:49:17
合計ジャッジ時間 3,672 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
12,580 KB
testcase_01 AC 16 ms
7,724 KB
testcase_02 AC 15 ms
7,864 KB
testcase_03 AC 16 ms
7,720 KB
testcase_04 AC 101 ms
17,944 KB
testcase_05 AC 45 ms
11,516 KB
testcase_06 AC 45 ms
11,892 KB
testcase_07 AC 46 ms
12,012 KB
testcase_08 AC 97 ms
18,368 KB
testcase_09 AC 111 ms
18,664 KB
testcase_10 AC 50 ms
12,380 KB
testcase_11 AC 85 ms
16,312 KB
testcase_12 AC 60 ms
13,388 KB
testcase_13 AC 55 ms
12,856 KB
testcase_14 AC 85 ms
17,144 KB
testcase_15 AC 18 ms
8,716 KB
testcase_16 AC 21 ms
8,892 KB
testcase_17 AC 18 ms
8,520 KB
testcase_18 AC 21 ms
8,732 KB
testcase_19 AC 22 ms
9,028 KB
testcase_20 AC 25 ms
9,392 KB
testcase_21 AC 26 ms
9,268 KB
testcase_22 AC 32 ms
10,276 KB
testcase_23 AC 63 ms
13,800 KB
testcase_24 AC 72 ms
16,100 KB
testcase_25 AC 109 ms
18,856 KB
testcase_26 AC 97 ms
19,036 KB
testcase_27 AC 72 ms
18,920 KB
testcase_28 AC 80 ms
18,720 KB
testcase_29 AC 96 ms
18,988 KB
testcase_30 AC 96 ms
18,792 KB
testcase_31 AC 100 ms
18,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(int(i) for i in input().split())

count=0
a.sort()
d=a[1]-a[0]
if d==0:
    count+=1
for i in range(len(a)-1):
    if a[i+1]-a[i]!=d:
        count+=1

if count==0:
    print('YES')
else:
    print('NO')
0