結果

問題 No.406 鴨等間隔の法則
ユーザー kutsutamakutsutama
提出日時 2018-12-28 00:23:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 654 ms
コンパイル使用メモリ 10,548 KB
実行使用メモリ 19,112 KB
最終ジャッジ日時 2023-09-21 18:57:21
合計ジャッジ時間 3,559 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
12,520 KB
testcase_01 AC 16 ms
7,896 KB
testcase_02 AC 15 ms
7,972 KB
testcase_03 AC 15 ms
7,924 KB
testcase_04 AC 65 ms
17,992 KB
testcase_05 AC 33 ms
11,460 KB
testcase_06 AC 35 ms
11,852 KB
testcase_07 AC 34 ms
11,944 KB
testcase_08 AC 67 ms
18,364 KB
testcase_09 AC 72 ms
18,768 KB
testcase_10 AC 37 ms
12,440 KB
testcase_11 AC 57 ms
16,528 KB
testcase_12 AC 42 ms
13,468 KB
testcase_13 AC 41 ms
12,916 KB
testcase_14 AC 93 ms
16,968 KB
testcase_15 AC 18 ms
8,836 KB
testcase_16 AC 20 ms
8,880 KB
testcase_17 AC 17 ms
8,600 KB
testcase_18 AC 18 ms
8,712 KB
testcase_19 AC 22 ms
8,976 KB
testcase_20 AC 25 ms
9,436 KB
testcase_21 AC 22 ms
9,392 KB
testcase_22 AC 34 ms
10,436 KB
testcase_23 AC 44 ms
13,708 KB
testcase_24 AC 78 ms
16,152 KB
testcase_25 AC 72 ms
18,800 KB
testcase_26 AC 104 ms
19,040 KB
testcase_27 AC 49 ms
19,112 KB
testcase_28 AC 49 ms
19,052 KB
testcase_29 AC 109 ms
18,964 KB
testcase_30 AC 105 ms
18,880 KB
testcase_31 AC 71 ms
18,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
x = [int(x) for x in input().split()]
x.sort()
sp = x[1] - x[0]
res = True
for i in range(len(x) - 1):
  d = x[i + 1] - x[i]
  if d == 0 or d != sp:
    res = False
    break
if res:
  print('YES')
else:
  print('NO')
0