結果

問題 No.406 鴨等間隔の法則
ユーザー moguoosanmoguoosan
提出日時 2016-08-19 20:10:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 308 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 10,532 KB
実行使用メモリ 21,692 KB
最終ジャッジ日時 2023-09-21 18:02:58
合計ジャッジ時間 3,031 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
15,060 KB
testcase_01 AC 16 ms
7,824 KB
testcase_02 AC 16 ms
7,872 KB
testcase_03 AC 15 ms
7,772 KB
testcase_04 AC 54 ms
21,024 KB
testcase_05 AC 30 ms
14,124 KB
testcase_06 AC 30 ms
14,588 KB
testcase_07 AC 31 ms
14,700 KB
testcase_08 AC 54 ms
21,692 KB
testcase_09 AC 57 ms
20,896 KB
testcase_10 AC 32 ms
14,980 KB
testcase_11 AC 43 ms
16,492 KB
testcase_12 AC 36 ms
15,076 KB
testcase_13 AC 35 ms
14,524 KB
testcase_14 AC 85 ms
20,148 KB
testcase_15 AC 17 ms
8,808 KB
testcase_16 AC 20 ms
9,584 KB
testcase_17 AC 17 ms
8,548 KB
testcase_18 AC 19 ms
9,668 KB
testcase_19 AC 22 ms
9,564 KB
testcase_20 AC 25 ms
10,024 KB
testcase_21 AC 22 ms
10,108 KB
testcase_22 AC 34 ms
12,752 KB
testcase_23 AC 36 ms
15,444 KB
testcase_24 AC 73 ms
16,444 KB
testcase_25 AC 57 ms
21,096 KB
testcase_26 AC 100 ms
21,068 KB
testcase_27 AC 48 ms
18,988 KB
testcase_28 AC 57 ms
21,088 KB
testcase_29 AC 97 ms
21,140 KB
testcase_30 AC 97 ms
20,976 KB
testcase_31 AC 55 ms
20,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
data = list(map(int,input().split(" ")))

if len(set(data)) != len(data):
    print("NO")
else:
    data.sort()
    bit =  data[1] - data[0]
    for i in range(1 , len(data) - 1):
        if data[i] + bit != data[i+1]:
            print("NO")
            break
    else:
        print("YES")
0