結果

問題 No.406 鴨等間隔の法則
ユーザー MaboyMaboy
提出日時 2018-02-18 22:50:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 220 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 10,624 KB
実行使用メモリ 21,500 KB
最終ジャッジ日時 2023-09-21 18:44:00
合計ジャッジ時間 3,263 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
15,196 KB
testcase_01 AC 16 ms
7,788 KB
testcase_02 AC 15 ms
7,792 KB
testcase_03 AC 15 ms
7,712 KB
testcase_04 AC 76 ms
20,940 KB
testcase_05 AC 39 ms
14,268 KB
testcase_06 AC 38 ms
14,216 KB
testcase_07 AC 38 ms
14,304 KB
testcase_08 AC 76 ms
20,952 KB
testcase_09 AC 81 ms
21,452 KB
testcase_10 AC 41 ms
15,080 KB
testcase_11 AC 64 ms
16,992 KB
testcase_12 AC 47 ms
14,716 KB
testcase_13 AC 45 ms
14,720 KB
testcase_14 AC 84 ms
20,272 KB
testcase_15 AC 17 ms
8,668 KB
testcase_16 AC 21 ms
9,412 KB
testcase_17 AC 18 ms
8,444 KB
testcase_18 AC 22 ms
9,468 KB
testcase_19 AC 22 ms
9,616 KB
testcase_20 AC 24 ms
10,024 KB
testcase_21 AC 25 ms
9,860 KB
testcase_22 AC 33 ms
13,048 KB
testcase_23 AC 50 ms
15,080 KB
testcase_24 AC 69 ms
15,856 KB
testcase_25 AC 83 ms
21,500 KB
testcase_26 AC 94 ms
21,412 KB
testcase_27 AC 53 ms
18,904 KB
testcase_28 AC 60 ms
21,316 KB
testcase_29 AC 93 ms
21,492 KB
testcase_30 AC 93 ms
21,288 KB
testcase_31 AC 79 ms
20,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def d():
  if len(set(x))!=n:return "NO"
  s=set()
  a=x.pop()
  while x:
    b=x.pop()
    s.add(a-b)
    a=b
  return ("NO","YES")[len(s)==1]

n=int(input())
x=sorted([i for i in map(int,input().split())])
print(d())

0