結果

問題 No.406 鴨等間隔の法則
ユーザー lloyzlloyz
提出日時 2023-01-17 21:20:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 220 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 10,716 KB
実行使用メモリ 19,012 KB
最終ジャッジ日時 2023-08-31 00:00:47
合計ジャッジ時間 3,956 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
12,512 KB
testcase_01 AC 15 ms
7,864 KB
testcase_02 AC 15 ms
8,168 KB
testcase_03 AC 15 ms
8,248 KB
testcase_04 AC 63 ms
18,088 KB
testcase_05 AC 32 ms
11,468 KB
testcase_06 AC 33 ms
11,980 KB
testcase_07 AC 33 ms
12,124 KB
testcase_08 AC 62 ms
18,348 KB
testcase_09 AC 68 ms
18,876 KB
testcase_10 AC 36 ms
12,228 KB
testcase_11 AC 55 ms
16,468 KB
testcase_12 AC 40 ms
13,568 KB
testcase_13 AC 39 ms
12,916 KB
testcase_14 AC 78 ms
17,220 KB
testcase_15 AC 16 ms
8,724 KB
testcase_16 AC 18 ms
8,988 KB
testcase_17 AC 17 ms
8,672 KB
testcase_18 AC 17 ms
8,920 KB
testcase_19 AC 21 ms
9,000 KB
testcase_20 AC 23 ms
9,488 KB
testcase_21 AC 21 ms
9,284 KB
testcase_22 AC 31 ms
10,532 KB
testcase_23 AC 42 ms
13,688 KB
testcase_24 AC 68 ms
15,968 KB
testcase_25 AC 67 ms
18,832 KB
testcase_26 AC 91 ms
18,944 KB
testcase_27 AC 47 ms
19,008 KB
testcase_28 AC 47 ms
18,968 KB
testcase_29 AC 89 ms
19,012 KB
testcase_30 AC 88 ms
18,716 KB
testcase_31 AC 65 ms
18,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
D = list(map(int, input().split()))

D.sort()
d = D[1] - D[0]
if d == 0:
    print("NO")
    exit()
for i in range(1, n - 1):
    if D[i + 1] - D[i] != d:
        print("NO")
        exit()
print("YES")
0