結果

問題 No.406 鴨等間隔の法則
ユーザー vwxyzvwxyz
提出日時 2022-08-05 23:04:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 10,724 KB
実行使用メモリ 19,392 KB
最終ジャッジ日時 2023-10-14 00:49:29
合計ジャッジ時間 4,742 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
13,356 KB
testcase_01 AC 18 ms
8,528 KB
testcase_02 AC 18 ms
8,420 KB
testcase_03 AC 19 ms
8,428 KB
testcase_04 AC 90 ms
18,148 KB
testcase_05 AC 42 ms
12,152 KB
testcase_06 AC 46 ms
12,484 KB
testcase_07 AC 46 ms
12,476 KB
testcase_08 AC 87 ms
18,184 KB
testcase_09 AC 97 ms
19,316 KB
testcase_10 AC 48 ms
12,932 KB
testcase_11 AC 77 ms
17,028 KB
testcase_12 AC 56 ms
13,860 KB
testcase_13 AC 53 ms
13,524 KB
testcase_14 AC 78 ms
17,700 KB
testcase_15 AC 21 ms
9,228 KB
testcase_16 AC 23 ms
9,252 KB
testcase_17 AC 21 ms
8,852 KB
testcase_18 AC 22 ms
9,572 KB
testcase_19 AC 24 ms
9,524 KB
testcase_20 AC 26 ms
9,816 KB
testcase_21 AC 28 ms
9,828 KB
testcase_22 AC 34 ms
10,788 KB
testcase_23 AC 59 ms
14,160 KB
testcase_24 AC 71 ms
16,268 KB
testcase_25 AC 98 ms
19,392 KB
testcase_26 AC 94 ms
19,384 KB
testcase_27 AC 70 ms
19,348 KB
testcase_28 AC 74 ms
19,276 KB
testcase_29 AC 92 ms
19,268 KB
testcase_30 AC 96 ms
19,244 KB
testcase_31 AC 96 ms
18,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline
from collections import Counter

N=int(readline())
X=sorted(list(map(int,readline().split())))
x0=X[0]
d=X[1]-X[0]
ans="YES"
for i in range(N):
    if X[i]!=x0+d*i:
        ans="NO"
if d==0:
    ans="NO"
print(ans)
0