結果

問題 No.406 鴨等間隔の法則
ユーザー はむ吉🐹はむ吉🐹
提出日時 2018-07-18 18:49:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 272 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 10,548 KB
実行使用メモリ 19,100 KB
最終ジャッジ日時 2023-09-21 18:52:24
合計ジャッジ時間 2,941 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
13,084 KB
testcase_01 AC 15 ms
7,780 KB
testcase_02 AC 14 ms
7,724 KB
testcase_03 AC 15 ms
7,728 KB
testcase_04 AC 78 ms
17,900 KB
testcase_05 AC 36 ms
12,916 KB
testcase_06 AC 37 ms
12,996 KB
testcase_07 AC 38 ms
12,976 KB
testcase_08 AC 75 ms
18,368 KB
testcase_09 AC 81 ms
18,728 KB
testcase_10 AC 40 ms
13,160 KB
testcase_11 AC 63 ms
16,520 KB
testcase_12 AC 47 ms
13,552 KB
testcase_13 AC 44 ms
13,284 KB
testcase_14 AC 70 ms
17,040 KB
testcase_15 AC 17 ms
8,816 KB
testcase_16 AC 18 ms
8,848 KB
testcase_17 AC 16 ms
8,360 KB
testcase_18 AC 18 ms
9,020 KB
testcase_19 AC 19 ms
9,072 KB
testcase_20 AC 21 ms
9,572 KB
testcase_21 AC 21 ms
9,940 KB
testcase_22 AC 29 ms
10,968 KB
testcase_23 AC 47 ms
13,800 KB
testcase_24 AC 61 ms
16,188 KB
testcase_25 AC 80 ms
18,932 KB
testcase_26 AC 83 ms
19,032 KB
testcase_27 AC 55 ms
19,100 KB
testcase_28 AC 57 ms
19,100 KB
testcase_29 AC 82 ms
19,076 KB
testcase_30 AC 81 ms
18,920 KB
testcase_31 AC 77 ms
18,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3


def main():
    _ = int(input())
    xs = sorted(int(x) for x in input().split())
    ds = [xj - xi for xi, xj in zip(xs[:-1], xs[1:])]
    print("YES" if ds[0] > 0 and all(d == ds[0] for d in ds) else "NO")


if __name__ == "__main__":
    main()
0