結果

問題 No.406 鴨等間隔の法則
ユーザー akasatanananaakasatananana
提出日時 2019-09-18 23:48:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 10,564 KB
実行使用メモリ 18,936 KB
最終ジャッジ日時 2023-09-21 19:07:54
合計ジャッジ時間 2,811 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
12,592 KB
testcase_01 AC 14 ms
7,756 KB
testcase_02 AC 14 ms
7,756 KB
testcase_03 AC 15 ms
7,944 KB
testcase_04 AC 65 ms
17,952 KB
testcase_05 AC 32 ms
11,616 KB
testcase_06 AC 33 ms
12,020 KB
testcase_07 AC 34 ms
11,900 KB
testcase_08 AC 65 ms
18,344 KB
testcase_09 AC 70 ms
18,816 KB
testcase_10 AC 36 ms
12,312 KB
testcase_11 AC 55 ms
16,388 KB
testcase_12 AC 40 ms
13,412 KB
testcase_13 AC 39 ms
12,984 KB
testcase_14 AC 82 ms
17,176 KB
testcase_15 AC 16 ms
8,676 KB
testcase_16 AC 17 ms
8,796 KB
testcase_17 AC 16 ms
8,500 KB
testcase_18 AC 16 ms
8,704 KB
testcase_19 AC 20 ms
9,072 KB
testcase_20 AC 23 ms
9,396 KB
testcase_21 AC 20 ms
9,288 KB
testcase_22 AC 31 ms
10,372 KB
testcase_23 AC 43 ms
13,792 KB
testcase_24 AC 72 ms
15,940 KB
testcase_25 AC 70 ms
18,796 KB
testcase_26 AC 95 ms
18,792 KB
testcase_27 AC 49 ms
18,936 KB
testcase_28 AC 49 ms
18,792 KB
testcase_29 AC 95 ms
18,836 KB
testcase_30 AC 94 ms
18,852 KB
testcase_31 AC 66 ms
18,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a=int(input())
b=[int(i) for i in input().split()]
b.sort()
c=b[1]-b[0]
if b.count(b[0])>=2:
    print("NO")
else:
    for i in range(1,a):
        d=b[i]-b[i-1]
        if c!=d:
            print("NO")
            break
    else:
        print("YES")
0