結果

問題 No.406 鴨等間隔の法則
ユーザー konabekonabe
提出日時 2018-03-29 08:52:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 85 ms / 2,000 ms
コード長 239 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 10,556 KB
実行使用メモリ 19,036 KB
最終ジャッジ日時 2023-09-21 18:46:45
合計ジャッジ時間 3,048 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
12,880 KB
testcase_01 AC 15 ms
7,776 KB
testcase_02 AC 14 ms
7,904 KB
testcase_03 AC 14 ms
7,760 KB
testcase_04 AC 79 ms
17,876 KB
testcase_05 AC 38 ms
12,692 KB
testcase_06 AC 38 ms
12,796 KB
testcase_07 AC 38 ms
12,816 KB
testcase_08 AC 78 ms
18,464 KB
testcase_09 AC 84 ms
18,788 KB
testcase_10 AC 41 ms
13,000 KB
testcase_11 AC 67 ms
16,588 KB
testcase_12 AC 48 ms
13,432 KB
testcase_13 AC 46 ms
12,940 KB
testcase_14 AC 73 ms
17,124 KB
testcase_15 AC 17 ms
8,676 KB
testcase_16 AC 18 ms
8,844 KB
testcase_17 AC 16 ms
8,512 KB
testcase_18 AC 17 ms
8,728 KB
testcase_19 AC 19 ms
9,208 KB
testcase_20 AC 21 ms
9,568 KB
testcase_21 AC 21 ms
9,944 KB
testcase_22 AC 28 ms
10,820 KB
testcase_23 AC 50 ms
13,712 KB
testcase_24 AC 62 ms
16,240 KB
testcase_25 AC 85 ms
18,804 KB
testcase_26 AC 84 ms
18,976 KB
testcase_27 AC 61 ms
19,036 KB
testcase_28 AC 64 ms
18,972 KB
testcase_29 AC 82 ms
18,992 KB
testcase_30 AC 82 ms
18,800 KB
testcase_31 AC 83 ms
18,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
X = list(map(int, input().split()))
X.sort()
Xsub = [X[i+1] - Xi for i, Xi in enumerate(X) if i != N-1]
toukankaku = [X == Xsub[0] for X in Xsub]

if all(toukankaku) and sum(Xsub)!=0:
    print('YES')
else:
    print('NO')
0