結果

問題 No.406 鴨等間隔の法則
ユーザー MarioMario
提出日時 2018-05-01 10:17:51
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 261 bytes
コンパイル時間 426 ms
コンパイル使用メモリ 10,740 KB
実行使用メモリ 18,968 KB
最終ジャッジ日時 2023-09-21 18:49:07
合計ジャッジ時間 3,183 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
12,560 KB
testcase_01 AC 16 ms
7,900 KB
testcase_02 AC 15 ms
7,836 KB
testcase_03 AC 14 ms
7,812 KB
testcase_04 AC 63 ms
17,864 KB
testcase_05 AC 31 ms
11,880 KB
testcase_06 AC 32 ms
11,980 KB
testcase_07 AC 33 ms
12,172 KB
testcase_08 AC 62 ms
18,356 KB
testcase_09 AC 69 ms
18,716 KB
testcase_10 AC 35 ms
12,456 KB
testcase_11 AC 54 ms
16,444 KB
testcase_12 AC 40 ms
13,448 KB
testcase_13 AC 38 ms
13,064 KB
testcase_14 AC 85 ms
17,168 KB
testcase_15 AC 16 ms
8,784 KB
testcase_16 AC 18 ms
9,024 KB
testcase_17 AC 15 ms
8,536 KB
testcase_18 AC 16 ms
8,872 KB
testcase_19 AC 20 ms
8,984 KB
testcase_20 AC 23 ms
9,400 KB
testcase_21 AC 19 ms
9,620 KB
testcase_22 AC 32 ms
10,388 KB
testcase_23 AC 40 ms
13,668 KB
testcase_24 AC 75 ms
15,932 KB
testcase_25 AC 65 ms
18,968 KB
testcase_26 AC 96 ms
18,800 KB
testcase_27 AC 45 ms
18,800 KB
testcase_28 AC 46 ms
18,800 KB
testcase_29 AC 99 ms
18,864 KB
testcase_30 AC 101 ms
18,672 KB
testcase_31 AC 66 ms
18,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

_ = input()
positions = sorted(list(map(int, input().split())))

d = positions[0] - positions[1]

for i, position in enumerate(positions[:-1]):
    D = positions[i] - positions[i+1]
    if D != d or D == 0:
       print("NO")
       break
else:
    print("YES")
0