結果

問題 No.406 鴨等間隔の法則
ユーザー j0tdj0td
提出日時 2018-01-16 19:27:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 339 bytes
コンパイル時間 119 ms
コンパイル使用メモリ 10,768 KB
実行使用メモリ 21,528 KB
最終ジャッジ日時 2023-09-21 18:42:49
合計ジャッジ時間 3,663 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
15,032 KB
testcase_01 AC 15 ms
7,864 KB
testcase_02 AC 16 ms
7,788 KB
testcase_03 AC 17 ms
7,784 KB
testcase_04 AC 111 ms
20,896 KB
testcase_05 AC 48 ms
14,204 KB
testcase_06 AC 51 ms
14,556 KB
testcase_07 AC 52 ms
14,636 KB
testcase_08 AC 117 ms
21,528 KB
testcase_09 AC 122 ms
20,916 KB
testcase_10 AC 54 ms
14,860 KB
testcase_11 AC 91 ms
17,004 KB
testcase_12 AC 65 ms
14,896 KB
testcase_13 AC 62 ms
14,644 KB
testcase_14 AC 96 ms
20,116 KB
testcase_15 AC 19 ms
8,648 KB
testcase_16 AC 22 ms
9,592 KB
testcase_17 AC 18 ms
8,696 KB
testcase_18 AC 21 ms
9,648 KB
testcase_19 AC 22 ms
9,564 KB
testcase_20 AC 26 ms
10,016 KB
testcase_21 AC 27 ms
9,944 KB
testcase_22 AC 36 ms
12,852 KB
testcase_23 AC 68 ms
15,268 KB
testcase_24 AC 81 ms
16,484 KB
testcase_25 AC 122 ms
21,044 KB
testcase_26 AC 113 ms
21,120 KB
testcase_27 AC 77 ms
18,980 KB
testcase_28 AC 96 ms
21,100 KB
testcase_29 AC 112 ms
21,044 KB
testcase_30 AC 109 ms
20,924 KB
testcase_31 AC 119 ms
20,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

KAMO = [int(i) for i in input().split()]
KAMO.sort()

KAMO_SET = set(KAMO)

DIST = abs(KAMO[0] - KAMO[1])

flag = True

if len(KAMO) != len(KAMO_SET):
    flag = False

for i in range(2, len(KAMO)):
    if abs(KAMO[i] - KAMO[i - 1]) != DIST:
        flag = False

if flag == False:
    print('NO')
else:
    print('YES')
0