結果

問題 No.406 鴨等間隔の法則
ユーザー uu
提出日時 2018-02-26 22:31:47
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 465 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 10,860 KB
実行使用メモリ 29,916 KB
最終ジャッジ日時 2023-09-21 18:45:17
合計ジャッジ時間 4,386 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
16,324 KB
testcase_01 AC 19 ms
8,524 KB
testcase_02 AC 20 ms
8,544 KB
testcase_03 AC 19 ms
8,636 KB
testcase_04 AC 151 ms
28,904 KB
testcase_05 AC 59 ms
15,536 KB
testcase_06 AC 62 ms
15,652 KB
testcase_07 AC 62 ms
15,812 KB
testcase_08 AC 149 ms
29,588 KB
testcase_09 AC 169 ms
29,684 KB
testcase_10 AC 69 ms
16,264 KB
testcase_11 AC 123 ms
20,700 KB
testcase_12 AC 85 ms
20,056 KB
testcase_13 AC 77 ms
19,700 KB
testcase_14 AC 127 ms
21,328 KB
testcase_15 AC 24 ms
9,116 KB
testcase_16 AC 27 ms
10,176 KB
testcase_17 AC 23 ms
9,252 KB
testcase_18 AC 26 ms
10,312 KB
testcase_19 AC 28 ms
10,068 KB
testcase_20 AC 33 ms
11,168 KB
testcase_21 AC 33 ms
11,336 KB
testcase_22 AC 45 ms
14,528 KB
testcase_23 AC 89 ms
20,280 KB
testcase_24 AC 100 ms
21,348 KB
testcase_25 AC 161 ms
29,756 KB
testcase_26 AC 145 ms
29,916 KB
testcase_27 AC 101 ms
19,500 KB
testcase_28 AC 119 ms
29,856 KB
testcase_29 AC 144 ms
29,880 KB
testcase_30 AC 147 ms
29,768 KB
testcase_31 AC 154 ms
29,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

n = int(input())
kamo = sorted([int(i) for i in input().split()], reverse=True)

isDuplicate = False
distance_list = []

counter = Counter(kamo)
if (set([len(Counter(kamo))]) - {1}) == set():
    isDuplicate = True


for i in range(len(kamo) - 1):
    distance = 0
    distance = kamo[i] - kamo[i + 1]
    distance_list.append(distance)


if not isDuplicate and (len(set(distance_list)) == 1):
    print("YES")
else:
    print("NO")
0