結果

問題 No.406 鴨等間隔の法則
ユーザー もりをもりを
提出日時 2020-04-25 22:15:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 231 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 23,868 KB
最終ジャッジ日時 2024-04-25 11:52:03
合計ジャッジ時間 4,161 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
16,864 KB
testcase_01 AC 31 ms
10,624 KB
testcase_02 AC 33 ms
10,624 KB
testcase_03 AC 30 ms
10,624 KB
testcase_04 AC 76 ms
22,516 KB
testcase_05 AC 48 ms
16,760 KB
testcase_06 AC 47 ms
16,124 KB
testcase_07 AC 48 ms
17,076 KB
testcase_08 AC 79 ms
23,104 KB
testcase_09 AC 79 ms
23,508 KB
testcase_10 AC 50 ms
16,520 KB
testcase_11 AC 64 ms
18,940 KB
testcase_12 AC 55 ms
17,704 KB
testcase_13 AC 54 ms
16,440 KB
testcase_14 AC 115 ms
22,784 KB
testcase_15 AC 32 ms
11,136 KB
testcase_16 AC 37 ms
12,032 KB
testcase_17 AC 37 ms
11,136 KB
testcase_18 AC 34 ms
12,032 KB
testcase_19 AC 38 ms
12,160 KB
testcase_20 AC 41 ms
12,544 KB
testcase_21 AC 40 ms
12,672 KB
testcase_22 AC 51 ms
15,492 KB
testcase_23 AC 54 ms
18,108 KB
testcase_24 AC 96 ms
18,612 KB
testcase_25 AC 80 ms
23,544 KB
testcase_26 AC 129 ms
23,804 KB
testcase_27 AC 70 ms
21,736 KB
testcase_28 AC 78 ms
23,480 KB
testcase_29 AC 131 ms
23,868 KB
testcase_30 AC 134 ms
23,672 KB
testcase_31 AC 77 ms
23,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int,input().split()))
if len(set(a)) != n:
    print('NO')
    exit(0)
a = sorted(a)
p = a[1] - a[0]
for i in range(n - 1):
    if p != a[i + 1] - a[i]:
        print('NO')
        exit(0)
print('YES')
0