結果

問題 No.406 鴨等間隔の法則
ユーザー punyfixpunyfix
提出日時 2017-09-23 20:22:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 231 bytes
コンパイル時間 117 ms
コンパイル使用メモリ 10,748 KB
実行使用メモリ 19,032 KB
最終ジャッジ日時 2023-09-21 18:34:49
合計ジャッジ時間 3,192 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
12,588 KB
testcase_01 AC 16 ms
7,764 KB
testcase_02 AC 17 ms
7,860 KB
testcase_03 AC 16 ms
7,864 KB
testcase_04 AC 65 ms
17,920 KB
testcase_05 AC 33 ms
11,704 KB
testcase_06 AC 34 ms
11,956 KB
testcase_07 AC 34 ms
12,028 KB
testcase_08 AC 65 ms
18,436 KB
testcase_09 AC 69 ms
18,876 KB
testcase_10 AC 36 ms
12,504 KB
testcase_11 AC 57 ms
16,508 KB
testcase_12 AC 42 ms
13,484 KB
testcase_13 AC 40 ms
13,028 KB
testcase_14 AC 104 ms
17,152 KB
testcase_15 AC 18 ms
8,756 KB
testcase_16 AC 19 ms
8,836 KB
testcase_17 AC 17 ms
8,548 KB
testcase_18 AC 18 ms
8,812 KB
testcase_19 AC 23 ms
9,092 KB
testcase_20 AC 27 ms
9,512 KB
testcase_21 AC 21 ms
9,560 KB
testcase_22 AC 36 ms
10,400 KB
testcase_23 AC 43 ms
13,684 KB
testcase_24 AC 90 ms
15,748 KB
testcase_25 AC 70 ms
18,900 KB
testcase_26 AC 114 ms
19,028 KB
testcase_27 AC 47 ms
19,032 KB
testcase_28 AC 49 ms
18,732 KB
testcase_29 AC 119 ms
18,980 KB
testcase_30 AC 119 ms
18,788 KB
testcase_31 AC 67 ms
18,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
x=list(map(int,input().split()))
x=sorted(x)
s=x[0+1]-x[0]
n=0

for i in range(1,N-1):
    if s != x[i+1]-x[i] or s == 0:
        n=1
        break
    s=x[i+1]-x[i]

if n == 1:
    print("NO")
else:
    print("YES")
0