結果

問題 No.406 鴨等間隔の法則
ユーザー ksomemoksomemo
提出日時 2017-10-01 01:05:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 10,596 KB
実行使用メモリ 21,204 KB
最終ジャッジ日時 2023-09-21 18:35:12
合計ジャッジ時間 3,050 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
14,968 KB
testcase_01 AC 16 ms
7,764 KB
testcase_02 AC 15 ms
7,732 KB
testcase_03 AC 16 ms
7,792 KB
testcase_04 AC 76 ms
20,884 KB
testcase_05 AC 36 ms
14,244 KB
testcase_06 AC 37 ms
14,196 KB
testcase_07 AC 38 ms
14,236 KB
testcase_08 AC 75 ms
20,872 KB
testcase_09 AC 81 ms
20,944 KB
testcase_10 AC 40 ms
14,968 KB
testcase_11 AC 62 ms
16,956 KB
testcase_12 AC 47 ms
14,980 KB
testcase_13 AC 43 ms
14,460 KB
testcase_14 AC 80 ms
20,128 KB
testcase_15 AC 17 ms
8,828 KB
testcase_16 AC 22 ms
9,376 KB
testcase_17 AC 18 ms
8,532 KB
testcase_18 AC 21 ms
9,616 KB
testcase_19 AC 22 ms
9,576 KB
testcase_20 AC 23 ms
10,036 KB
testcase_21 AC 25 ms
10,156 KB
testcase_22 AC 32 ms
13,144 KB
testcase_23 AC 47 ms
15,384 KB
testcase_24 AC 65 ms
16,168 KB
testcase_25 AC 80 ms
21,060 KB
testcase_26 AC 86 ms
21,204 KB
testcase_27 AC 49 ms
19,128 KB
testcase_28 AC 57 ms
21,116 KB
testcase_29 AC 90 ms
21,172 KB
testcase_30 AC 91 ms
20,872 KB
testcase_31 AC 79 ms
20,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    xs = map(int, input().split())
    xs = list(sorted(xs))

    if len(xs) != len(set(xs)):
        print("NO")
        return

    pairs = zip(xs[:-1], xs[1:])
    if len(set(abs(x1 - x2)
               for x1, x2 in pairs)) == 1:
        print("YES")
    else:
        print("NO")

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