結果

問題 No.406 鴨等間隔の法則
ユーザー notsix4notsix4
提出日時 2021-12-03 19:38:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 10,668 KB
実行使用メモリ 21,524 KB
最終ジャッジ日時 2023-09-20 05:54:16
合計ジャッジ時間 3,326 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
14,996 KB
testcase_01 AC 16 ms
7,900 KB
testcase_02 AC 16 ms
7,868 KB
testcase_03 AC 16 ms
7,848 KB
testcase_04 AC 63 ms
20,980 KB
testcase_05 AC 34 ms
14,100 KB
testcase_06 AC 34 ms
14,508 KB
testcase_07 AC 34 ms
14,560 KB
testcase_08 AC 63 ms
21,524 KB
testcase_09 AC 67 ms
20,952 KB
testcase_10 AC 36 ms
14,996 KB
testcase_11 AC 52 ms
16,484 KB
testcase_12 AC 41 ms
14,908 KB
testcase_13 AC 39 ms
14,484 KB
testcase_14 AC 95 ms
20,076 KB
testcase_15 AC 18 ms
8,680 KB
testcase_16 AC 20 ms
9,456 KB
testcase_17 AC 18 ms
8,728 KB
testcase_18 AC 21 ms
9,500 KB
testcase_19 AC 23 ms
9,480 KB
testcase_20 AC 25 ms
10,056 KB
testcase_21 AC 24 ms
10,052 KB
testcase_22 AC 36 ms
12,760 KB
testcase_23 AC 42 ms
15,296 KB
testcase_24 AC 73 ms
16,160 KB
testcase_25 AC 68 ms
21,092 KB
testcase_26 AC 97 ms
21,260 KB
testcase_27 AC 52 ms
19,140 KB
testcase_28 AC 67 ms
21,104 KB
testcase_29 AC 104 ms
21,140 KB
testcase_30 AC 108 ms
20,912 KB
testcase_31 AC 66 ms
20,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
l=[int(x) for x in input().split()]
nl=list(set(l))
c="YES"
if len(nl)==len(l):
    nl.sort()
    a=(nl[-1]-nl[0])/(n-1)

    for i in range(n-1):
        if nl[i+1]-nl[i]!=a:
            c="NO"
            break
else:
    c="NO"
print(c)
0