結果

問題 No.406 鴨等間隔の法則
ユーザー c-yanc-yan
提出日時 2020-07-30 03:48:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 127 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 21,736 KB
最終ジャッジ日時 2024-07-01 11:24:20
合計ジャッジ時間 3,839 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
15,412 KB
testcase_01 AC 29 ms
10,624 KB
testcase_02 AC 29 ms
10,624 KB
testcase_03 AC 29 ms
10,752 KB
testcase_04 AC 81 ms
20,312 KB
testcase_05 AC 47 ms
14,204 KB
testcase_06 AC 51 ms
14,460 KB
testcase_07 AC 49 ms
14,640 KB
testcase_08 AC 82 ms
21,016 KB
testcase_09 AC 86 ms
21,412 KB
testcase_10 AC 51 ms
15,392 KB
testcase_11 AC 73 ms
19,068 KB
testcase_12 AC 58 ms
16,116 KB
testcase_13 AC 55 ms
15,740 KB
testcase_14 AC 101 ms
19,624 KB
testcase_15 AC 31 ms
11,264 KB
testcase_16 AC 32 ms
11,520 KB
testcase_17 AC 30 ms
11,008 KB
testcase_18 AC 31 ms
11,648 KB
testcase_19 AC 36 ms
11,648 KB
testcase_20 AC 38 ms
12,032 KB
testcase_21 AC 35 ms
12,032 KB
testcase_22 AC 45 ms
13,068 KB
testcase_23 AC 58 ms
16,376 KB
testcase_24 AC 88 ms
18,608 KB
testcase_25 AC 88 ms
21,484 KB
testcase_26 AC 111 ms
21,736 KB
testcase_27 AC 63 ms
21,728 KB
testcase_28 AC 64 ms
21,480 KB
testcase_29 AC 109 ms
21,736 KB
testcase_30 AC 107 ms
21,480 KB
testcase_31 AC 84 ms
21,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

x.sort()
t = x[1] - x[0]

if t == 0:
    print('NO')
    exit()

for i in range(1, N - 1):
    if x[i + 1] - x[i] != t:
        break
else:
    print('YES')
    exit()
print('NO')
0