結果

問題 No.406 鴨等間隔の法則
ユーザー osrgy01osrgy01
提出日時 2021-01-07 10:27:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 233 bytes
コンパイル時間 488 ms
コンパイル使用メモリ 10,544 KB
実行使用メモリ 21,984 KB
最終ジャッジ日時 2023-08-07 19:03:58
合計ジャッジ時間 3,390 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
15,304 KB
testcase_01 AC 15 ms
7,876 KB
testcase_02 AC 15 ms
7,744 KB
testcase_03 AC 15 ms
7,740 KB
testcase_04 AC 73 ms
21,808 KB
testcase_05 AC 36 ms
14,376 KB
testcase_06 AC 37 ms
14,580 KB
testcase_07 AC 38 ms
14,624 KB
testcase_08 AC 73 ms
21,560 KB
testcase_09 AC 80 ms
21,680 KB
testcase_10 AC 39 ms
15,184 KB
testcase_11 AC 61 ms
17,348 KB
testcase_12 AC 46 ms
15,300 KB
testcase_13 AC 44 ms
14,896 KB
testcase_14 AC 91 ms
21,080 KB
testcase_15 AC 16 ms
8,728 KB
testcase_16 AC 21 ms
9,564 KB
testcase_17 AC 18 ms
8,544 KB
testcase_18 AC 21 ms
9,628 KB
testcase_19 AC 22 ms
9,636 KB
testcase_20 AC 24 ms
9,968 KB
testcase_21 AC 26 ms
10,256 KB
testcase_22 AC 34 ms
13,052 KB
testcase_23 AC 47 ms
15,532 KB
testcase_24 AC 75 ms
16,720 KB
testcase_25 AC 79 ms
21,920 KB
testcase_26 AC 107 ms
21,984 KB
testcase_27 AC 51 ms
18,920 KB
testcase_28 AC 57 ms
21,920 KB
testcase_29 AC 102 ms
21,828 KB
testcase_30 AC 103 ms
21,624 KB
testcase_31 AC 76 ms
21,416 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