結果

問題 No.406 鴨等間隔の法則
ユーザー はむ吉🐹はむ吉🐹
提出日時 2018-07-18 18:47:11
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 296 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 10,672 KB
実行使用メモリ 37,208 KB
最終ジャッジ日時 2023-09-21 18:52:20
合計ジャッジ時間 8,644 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 141 ms
32,680 KB
testcase_01 AC 120 ms
29,660 KB
testcase_02 AC 120 ms
29,428 KB
testcase_03 AC 122 ms
29,564 KB
testcase_04 AC 168 ms
36,288 KB
testcase_05 AC 138 ms
32,252 KB
testcase_06 AC 141 ms
32,376 KB
testcase_07 AC 139 ms
31,912 KB
testcase_08 AC 165 ms
37,208 KB
testcase_09 AC 168 ms
37,028 KB
testcase_10 AC 141 ms
32,816 KB
testcase_11 AC 157 ms
35,448 KB
testcase_12 AC 144 ms
33,212 KB
testcase_13 AC 141 ms
32,896 KB
testcase_14 AC 158 ms
35,684 KB
testcase_15 AC 124 ms
30,104 KB
testcase_16 AC 127 ms
30,308 KB
testcase_17 AC 125 ms
29,940 KB
testcase_18 AC 126 ms
30,344 KB
testcase_19 AC 127 ms
30,540 KB
testcase_20 AC 131 ms
30,720 KB
testcase_21 AC 131 ms
30,688 KB
testcase_22 AC 134 ms
31,276 KB
testcase_23 AC 151 ms
33,352 KB
testcase_24 AC 155 ms
35,096 KB
testcase_25 AC 168 ms
37,020 KB
testcase_26 AC 168 ms
37,104 KB
testcase_27 AC 161 ms
37,136 KB
testcase_28 AC 159 ms
37,052 KB
testcase_29 AC 169 ms
37,160 KB
testcase_30 AC 166 ms
37,028 KB
testcase_31 AC 164 ms
36,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3


import numpy


def main():
    _ = int(input())
    xs = numpy.fromiter((int(x) for x in input().split()), dtype=numpy.int32)
    xs.sort()
    ds = numpy.diff(xs)
    print("YES" if ds[0] > 0 and numpy.all(ds == ds[0])  else "NO")


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