結果

問題 No.406 鴨等間隔の法則
ユーザー HirakeHirake
提出日時 2017-06-16 11:23:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 150 ms / 2,000 ms
コード長 262 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 10,616 KB
実行使用メモリ 19,076 KB
最終ジャッジ日時 2023-09-21 18:29:21
合計ジャッジ時間 3,536 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
12,568 KB
testcase_01 AC 15 ms
7,824 KB
testcase_02 AC 16 ms
7,864 KB
testcase_03 AC 16 ms
7,884 KB
testcase_04 AC 67 ms
17,900 KB
testcase_05 AC 33 ms
11,380 KB
testcase_06 AC 35 ms
11,988 KB
testcase_07 AC 35 ms
11,848 KB
testcase_08 AC 66 ms
18,288 KB
testcase_09 AC 72 ms
18,868 KB
testcase_10 AC 36 ms
12,340 KB
testcase_11 AC 57 ms
16,432 KB
testcase_12 AC 43 ms
13,552 KB
testcase_13 AC 40 ms
13,000 KB
testcase_14 AC 130 ms
17,008 KB
testcase_15 AC 18 ms
8,672 KB
testcase_16 AC 19 ms
8,892 KB
testcase_17 AC 17 ms
8,508 KB
testcase_18 AC 19 ms
8,796 KB
testcase_19 AC 26 ms
9,080 KB
testcase_20 AC 30 ms
9,260 KB
testcase_21 AC 22 ms
9,280 KB
testcase_22 AC 43 ms
10,436 KB
testcase_23 AC 44 ms
13,836 KB
testcase_24 AC 108 ms
16,184 KB
testcase_25 AC 73 ms
18,856 KB
testcase_26 AC 149 ms
18,996 KB
testcase_27 AC 50 ms
19,076 KB
testcase_28 AC 50 ms
19,060 KB
testcase_29 AC 150 ms
19,016 KB
testcase_30 AC 149 ms
18,824 KB
testcase_31 AC 70 ms
18,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# your code goes here
#406 birds same distance
N=int(input())
x=[int(i) for i in input().split()]
x.sort()
#print(x)
i=0
while  i<N-2 and x[i+1]-x[i]!=0 and x[i+2]-x[i+1]==x[i+1]-x[i]:
 #   print(x[i+2])
    i+=1
if i==N-2:
    print("YES")
else:
    print("NO")
0