結果

問題 No.406 鴨等間隔の法則
ユーザー wata_pythonwata_python
提出日時 2019-08-16 14:01:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 227 bytes
コンパイル時間 67 ms
コンパイル使用メモリ 10,764 KB
実行使用メモリ 18,984 KB
最終ジャッジ日時 2023-09-21 19:07:11
合計ジャッジ時間 2,854 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
12,564 KB
testcase_01 AC 14 ms
7,824 KB
testcase_02 AC 14 ms
7,852 KB
testcase_03 AC 14 ms
7,820 KB
testcase_04 AC 61 ms
17,956 KB
testcase_05 AC 31 ms
11,808 KB
testcase_06 AC 31 ms
11,896 KB
testcase_07 AC 31 ms
12,060 KB
testcase_08 AC 60 ms
18,332 KB
testcase_09 AC 64 ms
18,832 KB
testcase_10 AC 33 ms
12,600 KB
testcase_11 AC 52 ms
16,580 KB
testcase_12 AC 38 ms
13,372 KB
testcase_13 AC 37 ms
13,032 KB
testcase_14 AC 88 ms
17,168 KB
testcase_15 AC 16 ms
8,792 KB
testcase_16 AC 17 ms
8,908 KB
testcase_17 AC 16 ms
8,440 KB
testcase_18 AC 16 ms
8,860 KB
testcase_19 AC 21 ms
9,000 KB
testcase_20 AC 23 ms
9,444 KB
testcase_21 AC 20 ms
9,432 KB
testcase_22 AC 34 ms
10,512 KB
testcase_23 AC 40 ms
13,672 KB
testcase_24 AC 77 ms
15,984 KB
testcase_25 AC 65 ms
18,784 KB
testcase_26 AC 99 ms
18,936 KB
testcase_27 AC 45 ms
18,984 KB
testcase_28 AC 47 ms
18,776 KB
testcase_29 AC 105 ms
18,844 KB
testcase_30 AC 107 ms
18,848 KB
testcase_31 AC 62 ms
18,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
l=sorted(list(map(int, input().split())))
X=0
for i in range(n-1):
    x=l[i]-l[i+1]
    if i==0:
        X=x
        continue
    if x!=X or x==0:
        print("NO")
        break
    X=x
else:
    print("YES")
0