結果

問題 No.406 鴨等間隔の法則
ユーザー akitsugu777akitsugu777
提出日時 2021-02-03 15:02:12
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 205 bytes
コンパイル時間 545 ms
コンパイル使用メモリ 10,668 KB
実行使用メモリ 18,952 KB
最終ジャッジ日時 2023-09-12 13:02:34
合計ジャッジ時間 3,473 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
12,604 KB
testcase_01 AC 15 ms
7,708 KB
testcase_02 AC 15 ms
7,936 KB
testcase_03 AC 17 ms
7,884 KB
testcase_04 AC 64 ms
17,876 KB
testcase_05 AC 32 ms
11,640 KB
testcase_06 AC 33 ms
11,976 KB
testcase_07 AC 34 ms
11,984 KB
testcase_08 AC 65 ms
18,376 KB
testcase_09 AC 69 ms
18,856 KB
testcase_10 AC 35 ms
12,168 KB
testcase_11 AC 56 ms
16,360 KB
testcase_12 AC 41 ms
13,480 KB
testcase_13 AC 40 ms
13,020 KB
testcase_14 AC 83 ms
17,208 KB
testcase_15 AC 17 ms
8,756 KB
testcase_16 AC 18 ms
8,960 KB
testcase_17 AC 18 ms
8,504 KB
testcase_18 AC 18 ms
8,860 KB
testcase_19 AC 21 ms
8,988 KB
testcase_20 AC 24 ms
9,300 KB
testcase_21 AC 22 ms
9,344 KB
testcase_22 AC 31 ms
10,400 KB
testcase_23 AC 44 ms
13,684 KB
testcase_24 AC 71 ms
15,828 KB
testcase_25 AC 70 ms
18,888 KB
testcase_26 AC 94 ms
18,948 KB
testcase_27 AC 47 ms
18,724 KB
testcase_28 AC 49 ms
18,952 KB
testcase_29 AC 96 ms
18,724 KB
testcase_30 AC 96 ms
18,656 KB
testcase_31 AC 67 ms
18,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
X = sorted(map(int, input().split()))

Z = 'NO'
Y = X[1] - X[0]
if Y != 0:
    for i in range(1, N-1):
        if X[i+1] - X[i] != Y:
            break
    else:
        Z ='YES'

print(Z)
0