結果

問題 No.406 鴨等間隔の法則
ユーザー na-shna-sh
提出日時 2019-07-08 13:30:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 285 bytes
コンパイル時間 67 ms
コンパイル使用メモリ 10,708 KB
実行使用メモリ 21,804 KB
最終ジャッジ日時 2023-09-21 19:04:13
合計ジャッジ時間 3,076 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
15,144 KB
testcase_01 AC 16 ms
7,904 KB
testcase_02 AC 15 ms
7,820 KB
testcase_03 AC 15 ms
7,764 KB
testcase_04 AC 72 ms
20,976 KB
testcase_05 AC 36 ms
14,532 KB
testcase_06 AC 36 ms
14,268 KB
testcase_07 AC 37 ms
14,284 KB
testcase_08 AC 71 ms
20,920 KB
testcase_09 AC 75 ms
21,480 KB
testcase_10 AC 38 ms
15,164 KB
testcase_11 AC 59 ms
17,004 KB
testcase_12 AC 45 ms
14,720 KB
testcase_13 AC 42 ms
14,796 KB
testcase_14 AC 79 ms
20,364 KB
testcase_15 AC 16 ms
8,840 KB
testcase_16 AC 20 ms
9,524 KB
testcase_17 AC 16 ms
8,540 KB
testcase_18 AC 18 ms
9,500 KB
testcase_19 AC 20 ms
9,504 KB
testcase_20 AC 23 ms
10,060 KB
testcase_21 AC 21 ms
10,048 KB
testcase_22 AC 33 ms
13,172 KB
testcase_23 AC 46 ms
15,112 KB
testcase_24 AC 66 ms
16,036 KB
testcase_25 AC 78 ms
21,704 KB
testcase_26 AC 88 ms
21,804 KB
testcase_27 AC 47 ms
18,972 KB
testcase_28 AC 56 ms
21,336 KB
testcase_29 AC 89 ms
21,728 KB
testcase_30 AC 88 ms
21,532 KB
testcase_31 AC 75 ms
20,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
x = list(map(int, input().split()))
x = sorted(x)

if len(set(x)) != N:
    print('NO')
else:
    a = x.pop(0)
    b = x.pop(0)
    d = b - a
    for c in x:
        if c - b != d:
            print('NO')
            break
        b = c
    else:
        print('YES')
0