結果

問題 No.406 鴨等間隔の法則
ユーザー 👑 yumechiyumechi
提出日時 2016-08-22 23:36:45
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 397 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 86,868 KB
実行使用メモリ 101,104 KB
最終ジャッジ日時 2023-09-21 18:04:45
合計ジャッジ時間 5,101 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
84,548 KB
testcase_01 AC 74 ms
71,292 KB
testcase_02 AC 73 ms
71,376 KB
testcase_03 AC 74 ms
71,228 KB
testcase_04 AC 117 ms
97,836 KB
testcase_05 AC 92 ms
82,252 KB
testcase_06 AC 92 ms
82,556 KB
testcase_07 AC 91 ms
83,392 KB
testcase_08 AC 115 ms
97,976 KB
testcase_09 AC 121 ms
100,840 KB
testcase_10 AC 92 ms
84,600 KB
testcase_11 AC 112 ms
94,968 KB
testcase_12 AC 97 ms
87,360 KB
testcase_13 AC 97 ms
87,060 KB
testcase_14 AC 115 ms
97,812 KB
testcase_15 AC 77 ms
75,592 KB
testcase_16 AC 79 ms
76,020 KB
testcase_17 AC 77 ms
75,852 KB
testcase_18 AC 77 ms
75,808 KB
testcase_19 AC 80 ms
75,972 KB
testcase_20 AC 82 ms
76,676 KB
testcase_21 AC 81 ms
76,464 KB
testcase_22 AC 85 ms
78,900 KB
testcase_23 AC 101 ms
88,916 KB
testcase_24 AC 110 ms
95,132 KB
testcase_25 AC 125 ms
100,928 KB
testcase_26 AC 123 ms
100,788 KB
testcase_27 AC 95 ms
85,924 KB
testcase_28 AC 109 ms
101,104 KB
testcase_29 AC 124 ms
100,892 KB
testcase_30 AC 124 ms
100,900 KB
testcase_31 AC 123 ms
100,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    n = int(input())
    xl = sorted([int(i) for i in input().split()])

    # condition 1
    if len(set(xl)) != n:
        print("NO")
        return

    #condition 2
    diff = abs(xl[0] - xl[1])
    for idx in range(1, n):
        if diff != abs(xl[idx-1] - xl[idx]):
            print("NO")
            return
    else:
        print("YES")

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