結果

問題 No.406 鴨等間隔の法則
ユーザー ryota-sakamotoryota-sakamoto
提出日時 2019-04-26 21:58:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 327 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 10,680 KB
実行使用メモリ 21,660 KB
最終ジャッジ日時 2023-09-21 19:01:58
合計ジャッジ時間 3,392 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
14,920 KB
testcase_01 AC 16 ms
7,812 KB
testcase_02 AC 16 ms
7,900 KB
testcase_03 AC 16 ms
8,072 KB
testcase_04 AC 83 ms
21,096 KB
testcase_05 AC 41 ms
14,172 KB
testcase_06 AC 41 ms
14,560 KB
testcase_07 AC 40 ms
14,672 KB
testcase_08 AC 85 ms
21,660 KB
testcase_09 AC 91 ms
21,028 KB
testcase_10 AC 43 ms
15,020 KB
testcase_11 AC 70 ms
16,544 KB
testcase_12 AC 51 ms
15,096 KB
testcase_13 AC 48 ms
14,712 KB
testcase_14 AC 105 ms
20,304 KB
testcase_15 AC 18 ms
8,844 KB
testcase_16 AC 23 ms
9,580 KB
testcase_17 AC 19 ms
8,504 KB
testcase_18 AC 21 ms
9,628 KB
testcase_19 AC 24 ms
9,584 KB
testcase_20 AC 26 ms
10,028 KB
testcase_21 AC 28 ms
9,956 KB
testcase_22 AC 38 ms
12,944 KB
testcase_23 AC 54 ms
15,492 KB
testcase_24 AC 87 ms
16,396 KB
testcase_25 AC 93 ms
21,140 KB
testcase_26 AC 119 ms
21,264 KB
testcase_27 AC 57 ms
19,136 KB
testcase_28 AC 68 ms
20,952 KB
testcase_29 AC 122 ms
21,232 KB
testcase_30 AC 119 ms
20,988 KB
testcase_31 AC 88 ms
20,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

def parse(n):
    return int(n)

n=int(input())
l=list(map(parse, input().split(" ")))
l.sort()

if len(set(l)) != len(l):
    print("NO")
    sys.exit()

l2=[]
for i in range(0, len(l) - 1):
    l2.append(l[i + 1] - l[i])
    
length=len(l2)
t=l2[0]
if sum(l2) == t * length:
    print("YES")
else:
    print("NO")
0