結果

問題 No.406 鴨等間隔の法則
ユーザー yurarayurara
提出日時 2019-05-17 00:50:26
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 268 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 10,628 KB
実行使用メモリ 19,180 KB
最終ジャッジ日時 2023-09-21 19:02:01
合計ジャッジ時間 3,040 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
12,532 KB
testcase_01 AC 17 ms
7,792 KB
testcase_02 AC 17 ms
7,920 KB
testcase_03 AC 15 ms
8,204 KB
testcase_04 AC 64 ms
17,864 KB
testcase_05 AC 32 ms
11,788 KB
testcase_06 AC 34 ms
11,868 KB
testcase_07 AC 34 ms
11,932 KB
testcase_08 AC 63 ms
18,428 KB
testcase_09 AC 69 ms
18,784 KB
testcase_10 AC 35 ms
12,548 KB
testcase_11 AC 56 ms
16,452 KB
testcase_12 AC 42 ms
13,572 KB
testcase_13 AC 39 ms
12,948 KB
testcase_14 AC 80 ms
17,172 KB
testcase_15 AC 17 ms
8,728 KB
testcase_16 AC 19 ms
9,000 KB
testcase_17 AC 17 ms
8,476 KB
testcase_18 AC 18 ms
8,816 KB
testcase_19 AC 21 ms
9,168 KB
testcase_20 AC 24 ms
9,320 KB
testcase_21 AC 21 ms
9,380 KB
testcase_22 AC 32 ms
10,560 KB
testcase_23 AC 43 ms
13,852 KB
testcase_24 AC 72 ms
15,824 KB
testcase_25 AC 69 ms
18,904 KB
testcase_26 AC 96 ms
18,976 KB
testcase_27 AC 46 ms
19,180 KB
testcase_28 AC 48 ms
18,840 KB
testcase_29 AC 98 ms
18,984 KB
testcase_30 AC 98 ms
18,792 KB
testcase_31 AC 66 ms
18,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

_ = input()
lst = list(map(int, input().split()))

lst.sort()

tmp = lst[1] - lst[0]

if tmp == 0:
    print('NO')
    sys.exit()

for t in range(len(lst) - 2):
    if lst[t + 2] - lst[t + 1] != tmp:
        print('NO')
        break
else:
    print('YES')
0