結果

問題 No.406 鴨等間隔の法則
ユーザー osrgy01osrgy01
提出日時 2021-01-07 10:27:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 233 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 24,504 KB
最終ジャッジ日時 2024-04-25 12:37:18
合計ジャッジ時間 3,854 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
16,772 KB
testcase_01 AC 26 ms
10,880 KB
testcase_02 AC 25 ms
10,624 KB
testcase_03 AC 28 ms
10,752 KB
testcase_04 AC 92 ms
23,284 KB
testcase_05 AC 48 ms
17,016 KB
testcase_06 AC 48 ms
17,284 KB
testcase_07 AC 48 ms
17,332 KB
testcase_08 AC 86 ms
23,228 KB
testcase_09 AC 92 ms
24,212 KB
testcase_10 AC 53 ms
16,632 KB
testcase_11 AC 72 ms
18,944 KB
testcase_12 AC 55 ms
17,640 KB
testcase_13 AC 51 ms
16,568 KB
testcase_14 AC 105 ms
23,292 KB
testcase_15 AC 27 ms
11,136 KB
testcase_16 AC 32 ms
12,160 KB
testcase_17 AC 29 ms
11,264 KB
testcase_18 AC 32 ms
12,160 KB
testcase_19 AC 33 ms
12,160 KB
testcase_20 AC 39 ms
12,672 KB
testcase_21 AC 37 ms
12,592 KB
testcase_22 AC 46 ms
15,748 KB
testcase_23 AC 61 ms
17,224 KB
testcase_24 AC 90 ms
18,740 KB
testcase_25 AC 92 ms
24,188 KB
testcase_26 AC 113 ms
24,504 KB
testcase_27 AC 60 ms
21,604 KB
testcase_28 AC 69 ms
24,256 KB
testcase_29 AC 119 ms
24,444 KB
testcase_30 AC 115 ms
24,316 KB
testcase_31 AC 89 ms
23,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=sorted(map(int,input().split()))
d=[0]*(n-1)
if len(set(a))==len(a):
    for i in range(1,n):
        d[i-1]=a[i]-a[i-1]
    if len(set(d))==1:
        print('YES')
    else:
        print('NO')
else:
    print('NO')
0