結果

問題 No.406 鴨等間隔の法則
ユーザー wata_pythonwata_python
提出日時 2019-08-16 13:58:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 702 ms
コンパイル使用メモリ 10,588 KB
実行使用メモリ 19,184 KB
最終ジャッジ日時 2023-09-21 19:07:15
合計ジャッジ時間 2,935 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
12,692 KB
testcase_01 AC 15 ms
7,900 KB
testcase_02 AC 15 ms
7,804 KB
testcase_03 AC 14 ms
7,920 KB
testcase_04 AC 60 ms
17,932 KB
testcase_05 AC 30 ms
11,844 KB
testcase_06 AC 31 ms
12,008 KB
testcase_07 AC 31 ms
12,076 KB
testcase_08 AC 60 ms
18,320 KB
testcase_09 AC 65 ms
18,808 KB
testcase_10 AC 34 ms
12,564 KB
testcase_11 AC 56 ms
16,392 KB
testcase_12 AC 39 ms
13,600 KB
testcase_13 AC 38 ms
12,936 KB
testcase_14 AC 99 ms
17,168 KB
testcase_15 AC 16 ms
8,736 KB
testcase_16 AC 17 ms
8,972 KB
testcase_17 AC 15 ms
8,532 KB
testcase_18 AC 16 ms
8,788 KB
testcase_19 AC 22 ms
9,060 KB
testcase_20 AC 27 ms
9,388 KB
testcase_21 AC 19 ms
9,532 KB
testcase_22 AC 35 ms
10,508 KB
testcase_23 AC 41 ms
13,888 KB
testcase_24 AC 87 ms
15,900 KB
testcase_25 AC 66 ms
18,836 KB
testcase_26 AC 112 ms
19,016 KB
testcase_27 AC 44 ms
19,184 KB
testcase_28 AC 45 ms
18,864 KB
testcase_29 AC 115 ms
18,952 KB
testcase_30 AC 111 ms
18,816 KB
testcase_31 AC 62 ms
18,652 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 l[i]==l[i+1]:
        print("NO")
        break
    X=x
else:
    print("YES")
0