結果

問題 No.406 鴨等間隔の法則
ユーザー akitsugu777akitsugu777
提出日時 2019-05-27 11:12:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 233 bytes
コンパイル時間 116 ms
コンパイル使用メモリ 10,628 KB
実行使用メモリ 19,132 KB
最終ジャッジ日時 2023-09-21 19:03:14
合計ジャッジ時間 3,531 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
13,112 KB
testcase_01 AC 15 ms
7,780 KB
testcase_02 AC 15 ms
7,756 KB
testcase_03 AC 16 ms
7,816 KB
testcase_04 AC 97 ms
17,892 KB
testcase_05 AC 44 ms
13,136 KB
testcase_06 AC 44 ms
13,268 KB
testcase_07 AC 45 ms
13,204 KB
testcase_08 AC 90 ms
18,468 KB
testcase_09 AC 99 ms
18,772 KB
testcase_10 AC 47 ms
13,424 KB
testcase_11 AC 81 ms
16,464 KB
testcase_12 AC 56 ms
13,412 KB
testcase_13 AC 53 ms
13,260 KB
testcase_14 AC 90 ms
17,052 KB
testcase_15 AC 18 ms
8,636 KB
testcase_16 AC 21 ms
9,688 KB
testcase_17 AC 17 ms
8,632 KB
testcase_18 AC 21 ms
9,600 KB
testcase_19 AC 23 ms
9,156 KB
testcase_20 AC 25 ms
9,360 KB
testcase_21 AC 26 ms
10,444 KB
testcase_22 AC 34 ms
10,536 KB
testcase_23 AC 60 ms
13,868 KB
testcase_24 AC 75 ms
15,916 KB
testcase_25 AC 104 ms
18,932 KB
testcase_26 AC 96 ms
18,912 KB
testcase_27 AC 72 ms
18,976 KB
testcase_28 AC 73 ms
18,892 KB
testcase_29 AC 93 ms
19,132 KB
testcase_30 AC 93 ms
18,812 KB
testcase_31 AC 94 ms
18,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
l = sorted(map(int, input().split()))

l2 = []
for i in range(n-1):
    l2.append(l[i+1] - l[i])

if len(set(l2)) > 1:
    print('NO')
elif len(set(l2)) == 1 and set(l2) == {0}:
    print('NO')
else:
    print('YES')
0