結果

問題 No.406 鴨等間隔の法則
ユーザー RyutoRyuto
提出日時 2018-03-31 16:50:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 157 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 1,425 ms
コンパイル使用メモリ 86,908 KB
実行使用メモリ 101,980 KB
最終ジャッジ日時 2023-09-21 18:47:00
合計ジャッジ時間 6,018 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
86,088 KB
testcase_01 AC 101 ms
71,728 KB
testcase_02 AC 100 ms
71,648 KB
testcase_03 AC 98 ms
71,740 KB
testcase_04 AC 138 ms
98,360 KB
testcase_05 AC 115 ms
83,536 KB
testcase_06 AC 114 ms
84,108 KB
testcase_07 AC 119 ms
84,744 KB
testcase_08 AC 137 ms
98,508 KB
testcase_09 AC 142 ms
101,448 KB
testcase_10 AC 118 ms
85,952 KB
testcase_11 AC 132 ms
95,908 KB
testcase_12 AC 122 ms
88,600 KB
testcase_13 AC 121 ms
88,364 KB
testcase_14 AC 148 ms
98,844 KB
testcase_15 AC 104 ms
77,280 KB
testcase_16 AC 107 ms
77,624 KB
testcase_17 AC 106 ms
77,552 KB
testcase_18 AC 106 ms
77,564 KB
testcase_19 AC 109 ms
77,608 KB
testcase_20 AC 108 ms
78,256 KB
testcase_21 AC 109 ms
78,104 KB
testcase_22 AC 114 ms
80,412 KB
testcase_23 AC 124 ms
90,140 KB
testcase_24 AC 142 ms
96,356 KB
testcase_25 AC 140 ms
101,248 KB
testcase_26 AC 157 ms
101,980 KB
testcase_27 AC 120 ms
86,472 KB
testcase_28 AC 139 ms
101,388 KB
testcase_29 AC 155 ms
101,964 KB
testcase_30 AC 156 ms
101,832 KB
testcase_31 AC 139 ms
101,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python

from collections import Counter

def main():
    n = int(input().strip())
    xs = [int(x) for x in input().split()]
    xv = Counter(xs).values()
    if max(xv) > 1:
        print('NO')
        exit()
    xs.sort()
    dx = xs[1] - xs[0]
    for i in range(1,n):
        if xs[i] - xs[i-1] != dx:
            print('NO')
            exit()
    print('YES')

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