結果

問題 No.406 鴨等間隔の法則
ユーザー Liny52551272Liny52551272
提出日時 2019-11-14 15:40:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 300 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 19,168 KB
最終ジャッジ日時 2023-09-21 19:09:31
合計ジャッジ時間 2,960 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
12,628 KB
testcase_01 AC 15 ms
7,936 KB
testcase_02 AC 14 ms
7,996 KB
testcase_03 AC 15 ms
7,856 KB
testcase_04 AC 64 ms
17,916 KB
testcase_05 AC 32 ms
11,780 KB
testcase_06 AC 34 ms
11,880 KB
testcase_07 AC 33 ms
11,964 KB
testcase_08 AC 63 ms
18,484 KB
testcase_09 AC 68 ms
18,788 KB
testcase_10 AC 35 ms
12,744 KB
testcase_11 AC 54 ms
16,496 KB
testcase_12 AC 41 ms
13,456 KB
testcase_13 AC 39 ms
12,932 KB
testcase_14 AC 81 ms
17,016 KB
testcase_15 AC 17 ms
8,812 KB
testcase_16 AC 18 ms
9,012 KB
testcase_17 AC 16 ms
8,532 KB
testcase_18 AC 17 ms
8,768 KB
testcase_19 AC 21 ms
9,196 KB
testcase_20 AC 23 ms
9,504 KB
testcase_21 AC 21 ms
9,560 KB
testcase_22 AC 31 ms
10,492 KB
testcase_23 AC 43 ms
13,840 KB
testcase_24 AC 70 ms
16,260 KB
testcase_25 AC 69 ms
18,836 KB
testcase_26 AC 92 ms
19,168 KB
testcase_27 AC 48 ms
19,088 KB
testcase_28 AC 48 ms
19,000 KB
testcase_29 AC 91 ms
19,076 KB
testcase_30 AC 92 ms
18,812 KB
testcase_31 AC 66 ms
18,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input().strip())
lst = [int(i) for i in input().strip().split()]
lst = sorted(lst)

if N == 1:
  print('YES')
else:
  tmp = lst[1] - lst[0]
  
  for i in range(len(lst) - 1):
    if tmp == 0 or tmp != lst[i + 1] - lst[i]:
      print('NO')
      break
  else:
    print('YES')
0