結果

問題 No.406 鴨等間隔の法則
ユーザー mokraimokrai
提出日時 2017-10-15 00:22:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 435 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 10,724 KB
実行使用メモリ 21,688 KB
最終ジャッジ日時 2023-09-21 18:41:50
合計ジャッジ時間 2,908 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
15,024 KB
testcase_01 AC 15 ms
7,856 KB
testcase_02 AC 15 ms
7,744 KB
testcase_03 AC 15 ms
7,844 KB
testcase_04 AC 58 ms
21,104 KB
testcase_05 AC 32 ms
14,160 KB
testcase_06 AC 32 ms
14,484 KB
testcase_07 AC 33 ms
14,560 KB
testcase_08 AC 58 ms
21,688 KB
testcase_09 AC 62 ms
20,980 KB
testcase_10 AC 34 ms
15,100 KB
testcase_11 AC 49 ms
16,500 KB
testcase_12 AC 37 ms
14,980 KB
testcase_13 AC 35 ms
14,556 KB
testcase_14 AC 78 ms
20,096 KB
testcase_15 AC 18 ms
8,688 KB
testcase_16 AC 20 ms
9,492 KB
testcase_17 AC 18 ms
8,620 KB
testcase_18 AC 19 ms
9,604 KB
testcase_19 AC 21 ms
9,604 KB
testcase_20 AC 23 ms
10,040 KB
testcase_21 AC 23 ms
10,056 KB
testcase_22 AC 31 ms
12,856 KB
testcase_23 AC 39 ms
15,384 KB
testcase_24 AC 65 ms
16,220 KB
testcase_25 AC 64 ms
21,052 KB
testcase_26 AC 89 ms
21,188 KB
testcase_27 AC 51 ms
19,036 KB
testcase_28 AC 62 ms
20,996 KB
testcase_29 AC 90 ms
21,172 KB
testcase_30 AC 87 ms
20,908 KB
testcase_31 AC 60 ms
20,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n = int(input())
    l = [int(i) for i in input().split()]
    if len(l) != len(list(set(l))):
        print("NO")
    else:
        sorted_list = sorted(l)
        diff = sorted_list[1] - sorted_list[0]
        for i in range(len(sorted_list) - 1):
            if diff != sorted_list[i+1] - sorted_list[i]:
                print("NO")
                return
        print("YES")

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