結果

問題 No.406 鴨等間隔の法則
ユーザー takakintakakin
提出日時 2020-03-30 17:36:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 284 bytes
コンパイル時間 435 ms
コンパイル使用メモリ 10,464 KB
実行使用メモリ 19,072 KB
最終ジャッジ日時 2023-09-21 19:31:15
合計ジャッジ時間 3,234 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
12,640 KB
testcase_01 AC 15 ms
7,772 KB
testcase_02 AC 15 ms
7,856 KB
testcase_03 AC 15 ms
7,840 KB
testcase_04 AC 65 ms
17,828 KB
testcase_05 AC 32 ms
11,828 KB
testcase_06 AC 34 ms
11,956 KB
testcase_07 AC 33 ms
11,960 KB
testcase_08 AC 65 ms
18,404 KB
testcase_09 AC 72 ms
18,696 KB
testcase_10 AC 37 ms
12,576 KB
testcase_11 AC 57 ms
16,472 KB
testcase_12 AC 42 ms
13,428 KB
testcase_13 AC 40 ms
13,008 KB
testcase_14 AC 80 ms
16,992 KB
testcase_15 AC 18 ms
8,712 KB
testcase_16 AC 18 ms
8,872 KB
testcase_17 AC 16 ms
8,492 KB
testcase_18 AC 17 ms
8,744 KB
testcase_19 AC 22 ms
8,980 KB
testcase_20 AC 23 ms
9,500 KB
testcase_21 AC 21 ms
9,420 KB
testcase_22 AC 31 ms
10,456 KB
testcase_23 AC 43 ms
13,824 KB
testcase_24 AC 71 ms
15,784 KB
testcase_25 AC 71 ms
18,840 KB
testcase_26 AC 95 ms
18,976 KB
testcase_27 AC 50 ms
19,072 KB
testcase_28 AC 50 ms
18,812 KB
testcase_29 AC 89 ms
19,072 KB
testcase_30 AC 89 ms
18,872 KB
testcase_31 AC 66 ms
18,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
X=sorted([int(i) for i in input().split()])
d=X[1]-X[0]
if d==0:
  print("NO")
else:
  for i in range(n-2):
    if d==X[i+2]-X[i+1]:
      continue
    else:
      print("NO")
      break
  else:
    print("YES")

0