結果

問題 No.406 鴨等間隔の法則
ユーザー vorg101vorg101
提出日時 2016-08-05 22:28:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 64 ms
コンパイル使用メモリ 10,608 KB
実行使用メモリ 19,024 KB
最終ジャッジ日時 2023-09-21 17:42:00
合計ジャッジ時間 3,109 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
12,612 KB
testcase_01 AC 14 ms
7,948 KB
testcase_02 AC 15 ms
7,864 KB
testcase_03 AC 14 ms
7,992 KB
testcase_04 AC 88 ms
18,032 KB
testcase_05 AC 40 ms
11,660 KB
testcase_06 AC 40 ms
11,904 KB
testcase_07 AC 42 ms
11,920 KB
testcase_08 AC 84 ms
18,484 KB
testcase_09 AC 92 ms
18,732 KB
testcase_10 AC 44 ms
12,220 KB
testcase_11 AC 74 ms
16,456 KB
testcase_12 AC 51 ms
13,472 KB
testcase_13 AC 50 ms
13,064 KB
testcase_14 AC 77 ms
17,212 KB
testcase_15 AC 19 ms
8,864 KB
testcase_16 AC 19 ms
9,032 KB
testcase_17 AC 17 ms
8,476 KB
testcase_18 AC 19 ms
8,880 KB
testcase_19 AC 20 ms
9,092 KB
testcase_20 AC 23 ms
9,300 KB
testcase_21 AC 23 ms
9,428 KB
testcase_22 AC 30 ms
10,472 KB
testcase_23 AC 53 ms
13,856 KB
testcase_24 AC 69 ms
15,904 KB
testcase_25 AC 92 ms
18,900 KB
testcase_26 AC 89 ms
18,976 KB
testcase_27 AC 70 ms
19,016 KB
testcase_28 AC 71 ms
18,840 KB
testcase_29 AC 89 ms
19,024 KB
testcase_30 AC 90 ms
18,856 KB
testcase_31 AC 89 ms
18,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
X = list(map(int, input().split(' ')))
X.sort()
flag = True
diff = X[1] - X[0]
for i in range(1, N - 1):
    if X[i+1] - X[i] != diff or diff == 0:
        flag = False

if flag:
    print("YES")
else:
    print("NO")
0