結果

問題 No.406 鴨等間隔の法則
ユーザー S6136OS6136O
提出日時 2017-09-20 20:52:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 261 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 10,620 KB
実行使用メモリ 19,104 KB
最終ジャッジ日時 2023-09-21 18:34:37
合計ジャッジ時間 3,321 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
12,524 KB
testcase_01 AC 15 ms
7,752 KB
testcase_02 AC 15 ms
7,736 KB
testcase_03 AC 16 ms
7,812 KB
testcase_04 AC 90 ms
17,956 KB
testcase_05 AC 41 ms
12,344 KB
testcase_06 AC 42 ms
12,512 KB
testcase_07 AC 43 ms
12,408 KB
testcase_08 AC 90 ms
18,244 KB
testcase_09 AC 96 ms
18,696 KB
testcase_10 AC 45 ms
12,568 KB
testcase_11 AC 76 ms
16,508 KB
testcase_12 AC 55 ms
13,544 KB
testcase_13 AC 52 ms
13,032 KB
testcase_14 AC 88 ms
17,128 KB
testcase_15 AC 19 ms
8,632 KB
testcase_16 AC 20 ms
8,904 KB
testcase_17 AC 18 ms
8,368 KB
testcase_18 AC 20 ms
8,732 KB
testcase_19 AC 22 ms
9,112 KB
testcase_20 AC 25 ms
9,360 KB
testcase_21 AC 25 ms
9,872 KB
testcase_22 AC 33 ms
10,740 KB
testcase_23 AC 55 ms
13,804 KB
testcase_24 AC 77 ms
15,908 KB
testcase_25 AC 97 ms
18,720 KB
testcase_26 AC 104 ms
19,100 KB
testcase_27 AC 66 ms
19,064 KB
testcase_28 AC 72 ms
18,888 KB
testcase_29 AC 107 ms
19,104 KB
testcase_30 AC 105 ms
18,876 KB
testcase_31 AC 92 ms
18,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
data = list(map(int, input().split()))
data.sort()
diffs = []

for i in range(1, n):
    diffs.append(data[i-1] - data[i])

diff_1 = diffs[0]
for d in diffs:
    if d != diff_1 or d == 0:
        print("NO")
        break
else:
    print("YES")
0