結果

問題 No.406 鴨等間隔の法則
ユーザー Haruki0804SHaruki0804S
提出日時 2018-10-30 11:15:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 201 ms / 2,000 ms
コード長 345 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 16,036 KB
最終ジャッジ日時 2023-09-21 18:54:21
合計ジャッジ時間 3,578 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
11,320 KB
testcase_01 AC 15 ms
7,728 KB
testcase_02 AC 15 ms
7,860 KB
testcase_03 AC 15 ms
7,892 KB
testcase_04 AC 79 ms
14,968 KB
testcase_05 AC 38 ms
10,680 KB
testcase_06 AC 40 ms
10,644 KB
testcase_07 AC 39 ms
10,876 KB
testcase_08 AC 79 ms
14,972 KB
testcase_09 AC 84 ms
16,036 KB
testcase_10 AC 44 ms
11,176 KB
testcase_11 AC 68 ms
13,992 KB
testcase_12 AC 49 ms
11,908 KB
testcase_13 AC 47 ms
11,488 KB
testcase_14 AC 166 ms
14,384 KB
testcase_15 AC 18 ms
8,572 KB
testcase_16 AC 19 ms
8,616 KB
testcase_17 AC 17 ms
8,452 KB
testcase_18 AC 18 ms
8,720 KB
testcase_19 AC 29 ms
8,660 KB
testcase_20 AC 36 ms
9,052 KB
testcase_21 AC 23 ms
9,112 KB
testcase_22 AC 54 ms
9,832 KB
testcase_23 AC 52 ms
12,164 KB
testcase_24 AC 144 ms
14,032 KB
testcase_25 AC 85 ms
16,024 KB
testcase_26 AC 197 ms
15,860 KB
testcase_27 AC 63 ms
15,888 KB
testcase_28 AC 65 ms
15,964 KB
testcase_29 AC 201 ms
15,884 KB
testcase_30 AC 195 ms
15,848 KB
testcase_31 AC 81 ms
15,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
X=input().split(' ')


for i in range(N):
    X[i]=int(X[i])




list.sort(X)


S=[]
for i in range(N-1):
    d=X[i+1]-X[i]
    S.append(d)
    S=list(set(S))#重複要素の削除
    if(len(S)!=1):
       print('NO')
       break
    elif(int(S[0])==0):
       print('NO')
       break
    elif(i==N-2):
       print('YES')




0