結果

問題 No.406 鴨等間隔の法則
ユーザー GrayCoderGrayCoder
提出日時 2017-08-12 10:23:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 316 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 20,032 KB
最終ジャッジ日時 2023-09-21 18:33:47
合計ジャッジ時間 2,896 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
12,516 KB
testcase_01 AC 15 ms
7,736 KB
testcase_02 AC 16 ms
7,824 KB
testcase_03 AC 16 ms
7,740 KB
testcase_04 AC 63 ms
17,920 KB
testcase_05 AC 32 ms
11,752 KB
testcase_06 AC 33 ms
11,960 KB
testcase_07 AC 33 ms
11,884 KB
testcase_08 AC 62 ms
17,936 KB
testcase_09 AC 67 ms
19,100 KB
testcase_10 AC 35 ms
12,452 KB
testcase_11 AC 56 ms
17,308 KB
testcase_12 AC 41 ms
14,060 KB
testcase_13 AC 39 ms
13,008 KB
testcase_14 AC 68 ms
16,984 KB
testcase_15 AC 17 ms
8,804 KB
testcase_16 AC 18 ms
8,828 KB
testcase_17 AC 17 ms
8,452 KB
testcase_18 AC 18 ms
8,956 KB
testcase_19 AC 20 ms
9,076 KB
testcase_20 AC 22 ms
9,492 KB
testcase_21 AC 21 ms
9,436 KB
testcase_22 AC 28 ms
10,524 KB
testcase_23 AC 42 ms
14,004 KB
testcase_24 AC 60 ms
15,912 KB
testcase_25 AC 68 ms
19,064 KB
testcase_26 AC 77 ms
20,032 KB
testcase_27 AC 47 ms
20,000 KB
testcase_28 AC 47 ms
19,160 KB
testcase_29 AC 79 ms
20,000 KB
testcase_30 AC 77 ms
18,976 KB
testcase_31 AC 66 ms
18,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    X = tuple(map(int, input().split()))

    x = sorted(X)
    l = x[1] - x[0]
    if l == 0:
        print('NO')
        return

    for i in range(1, N):
        if x[i] - x[i-1] != l:
            ans = 'NO'
            break
    else:
        ans = 'YES'

    print(ans)

main()
0