結果

問題 No.406 鴨等間隔の法則
ユーザー kisaragi211kisaragi211
提出日時 2018-01-17 22:57:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 19,176 KB
最終ジャッジ日時 2023-09-21 18:45:59
合計ジャッジ時間 2,980 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
12,600 KB
testcase_01 AC 17 ms
7,836 KB
testcase_02 AC 16 ms
7,812 KB
testcase_03 AC 16 ms
7,868 KB
testcase_04 AC 70 ms
17,980 KB
testcase_05 AC 35 ms
12,260 KB
testcase_06 AC 35 ms
12,472 KB
testcase_07 AC 39 ms
12,528 KB
testcase_08 AC 70 ms
18,340 KB
testcase_09 AC 78 ms
18,852 KB
testcase_10 AC 39 ms
12,644 KB
testcase_11 AC 62 ms
16,404 KB
testcase_12 AC 44 ms
13,540 KB
testcase_13 AC 43 ms
13,080 KB
testcase_14 AC 71 ms
17,136 KB
testcase_15 AC 17 ms
8,704 KB
testcase_16 AC 18 ms
8,836 KB
testcase_17 AC 16 ms
8,496 KB
testcase_18 AC 17 ms
8,724 KB
testcase_19 AC 20 ms
9,100 KB
testcase_20 AC 22 ms
9,472 KB
testcase_21 AC 22 ms
9,636 KB
testcase_22 AC 29 ms
10,552 KB
testcase_23 AC 46 ms
13,844 KB
testcase_24 AC 64 ms
15,932 KB
testcase_25 AC 77 ms
18,852 KB
testcase_26 AC 82 ms
19,176 KB
testcase_27 AC 53 ms
18,996 KB
testcase_28 AC 56 ms
18,956 KB
testcase_29 AC 82 ms
19,056 KB
testcase_30 AC 81 ms
18,928 KB
testcase_31 AC 76 ms
18,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    x = list(map(int, input().split()))
    x.sort()
    dif = []
    for i in range(N-1):
        dif.append(x[i+1] - x[i])
    for j in range(len(dif)-1):
        if dif[j]!=dif[j+1] or dif[j]==0:
            return print('NO')
    return print('YES')
        
if __name__ == '__main__':
    main()
0