結果

問題 No.406 鴨等間隔の法則
ユーザー naoe123naoe123
提出日時 2020-01-11 09:50:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 21,636 KB
最終ジャッジ日時 2023-09-21 19:11:15
合計ジャッジ時間 3,322 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
15,028 KB
testcase_01 AC 16 ms
7,712 KB
testcase_02 AC 15 ms
7,820 KB
testcase_03 AC 16 ms
7,868 KB
testcase_04 AC 74 ms
21,168 KB
testcase_05 AC 40 ms
14,212 KB
testcase_06 AC 37 ms
14,708 KB
testcase_07 AC 38 ms
14,656 KB
testcase_08 AC 75 ms
21,636 KB
testcase_09 AC 81 ms
20,928 KB
testcase_10 AC 41 ms
14,940 KB
testcase_11 AC 63 ms
17,092 KB
testcase_12 AC 46 ms
14,936 KB
testcase_13 AC 45 ms
14,636 KB
testcase_14 AC 86 ms
20,312 KB
testcase_15 AC 17 ms
8,872 KB
testcase_16 AC 19 ms
9,604 KB
testcase_17 AC 17 ms
8,608 KB
testcase_18 AC 19 ms
9,684 KB
testcase_19 AC 22 ms
9,612 KB
testcase_20 AC 25 ms
10,044 KB
testcase_21 AC 22 ms
9,988 KB
testcase_22 AC 33 ms
12,924 KB
testcase_23 AC 48 ms
15,308 KB
testcase_24 AC 73 ms
16,408 KB
testcase_25 AC 81 ms
21,160 KB
testcase_26 AC 99 ms
21,164 KB
testcase_27 AC 51 ms
18,832 KB
testcase_28 AC 58 ms
21,024 KB
testcase_29 AC 102 ms
21,012 KB
testcase_30 AC 97 ms
20,940 KB
testcase_31 AC 77 ms
20,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
x=list(map(int,input().split()))

def has_duplicates(seq):
    return len(seq) != len(set(seq))

x.sort()
flag=True
if has_duplicates(x):
    print('NO')
else:
    d=x[1]-x[0]
    for i in range(N-1):
        if x[i+1]-x[i]!=d:
            flag=False
            break
    if flag:
        print('YES')
    else:
        print('NO')

0