結果

問題 No.406 鴨等間隔の法則
ユーザー lhanlhan
提出日時 2018-02-24 23:06:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 183 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 10,688 KB
実行使用メモリ 19,064 KB
最終ジャッジ日時 2023-09-21 18:44:28
合計ジャッジ時間 2,902 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
12,536 KB
testcase_01 AC 16 ms
7,704 KB
testcase_02 AC 15 ms
7,792 KB
testcase_03 AC 16 ms
7,708 KB
testcase_04 AC 67 ms
17,952 KB
testcase_05 AC 33 ms
11,620 KB
testcase_06 AC 34 ms
11,964 KB
testcase_07 AC 34 ms
12,148 KB
testcase_08 AC 66 ms
18,284 KB
testcase_09 AC 71 ms
18,828 KB
testcase_10 AC 37 ms
12,576 KB
testcase_11 AC 57 ms
16,388 KB
testcase_12 AC 42 ms
13,392 KB
testcase_13 AC 40 ms
12,920 KB
testcase_14 AC 74 ms
16,996 KB
testcase_15 AC 18 ms
8,808 KB
testcase_16 AC 19 ms
8,876 KB
testcase_17 AC 17 ms
8,256 KB
testcase_18 AC 18 ms
8,736 KB
testcase_19 AC 21 ms
9,084 KB
testcase_20 AC 23 ms
9,472 KB
testcase_21 AC 21 ms
9,412 KB
testcase_22 AC 29 ms
10,348 KB
testcase_23 AC 44 ms
13,780 KB
testcase_24 AC 63 ms
15,868 KB
testcase_25 AC 71 ms
18,872 KB
testcase_26 AC 82 ms
19,064 KB
testcase_27 AC 49 ms
18,936 KB
testcase_28 AC 51 ms
18,852 KB
testcase_29 AC 82 ms
18,980 KB
testcase_30 AC 82 ms
18,748 KB
testcase_31 AC 68 ms
18,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

ds = sorted([int(x) for x in input().split()])

d = ds[1] - ds[0]

if d > 0 and all(ds[i+1] - ds[i] == d for i in range(n-1)):
    print('YES')
else:
    print('NO')
0