結果

問題 No.406 鴨等間隔の法則
ユーザー gorugo30gorugo30
提出日時 2021-02-23 00:04:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 376 ms
コンパイル使用メモリ 81,696 KB
実行使用メモリ 83,284 KB
最終ジャッジ日時 2023-10-21 18:06:16
合計ジャッジ時間 4,282 ms
ジャッジサーバーID
(参考情報)
judge10 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
68,596 KB
testcase_01 AC 39 ms
53,404 KB
testcase_02 AC 39 ms
53,404 KB
testcase_03 AC 41 ms
53,404 KB
testcase_04 AC 74 ms
80,952 KB
testcase_05 AC 53 ms
66,948 KB
testcase_06 AC 54 ms
67,148 KB
testcase_07 AC 54 ms
67,772 KB
testcase_08 AC 75 ms
80,912 KB
testcase_09 AC 79 ms
82,808 KB
testcase_10 AC 55 ms
68,592 KB
testcase_11 AC 69 ms
77,020 KB
testcase_12 AC 59 ms
69,716 KB
testcase_13 AC 58 ms
69,576 KB
testcase_14 AC 74 ms
81,204 KB
testcase_15 AC 44 ms
59,828 KB
testcase_16 AC 43 ms
59,428 KB
testcase_17 AC 43 ms
59,428 KB
testcase_18 AC 42 ms
59,428 KB
testcase_19 AC 45 ms
61,876 KB
testcase_20 AC 46 ms
61,876 KB
testcase_21 AC 44 ms
61,476 KB
testcase_22 AC 51 ms
65,244 KB
testcase_23 AC 61 ms
72,736 KB
testcase_24 AC 69 ms
77,260 KB
testcase_25 AC 78 ms
82,848 KB
testcase_26 AC 81 ms
83,284 KB
testcase_27 AC 63 ms
82,696 KB
testcase_28 AC 63 ms
83,024 KB
testcase_29 AC 80 ms
83,284 KB
testcase_30 AC 79 ms
83,208 KB
testcase_31 AC 83 ms
82,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
ans = True
S = list(map(int, input().split()))
S.sort()
d = S[1] - S[0]
for i in range(1, N - 1):
    if d != S[i + 1] - S[i]:
        ans = False
        break
if ans and d != 0:
    print("YES")
else:
    print("NO")
0