結果

問題 No.406 鴨等間隔の法則
ユーザー nanaenanae
提出日時 2017-01-05 09:31:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 123 ms
コンパイル使用メモリ 10,552 KB
実行使用メモリ 19,000 KB
最終ジャッジ日時 2023-09-21 18:20:45
合計ジャッジ時間 3,060 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
12,516 KB
testcase_01 AC 15 ms
7,768 KB
testcase_02 AC 15 ms
7,748 KB
testcase_03 AC 15 ms
7,828 KB
testcase_04 AC 65 ms
17,860 KB
testcase_05 AC 33 ms
11,412 KB
testcase_06 AC 33 ms
11,844 KB
testcase_07 AC 34 ms
12,056 KB
testcase_08 AC 66 ms
18,452 KB
testcase_09 AC 71 ms
18,888 KB
testcase_10 AC 37 ms
12,392 KB
testcase_11 AC 57 ms
16,452 KB
testcase_12 AC 42 ms
13,416 KB
testcase_13 AC 41 ms
13,028 KB
testcase_14 AC 84 ms
17,076 KB
testcase_15 AC 17 ms
8,832 KB
testcase_16 AC 19 ms
8,872 KB
testcase_17 AC 17 ms
8,492 KB
testcase_18 AC 18 ms
8,732 KB
testcase_19 AC 22 ms
9,100 KB
testcase_20 AC 25 ms
9,320 KB
testcase_21 AC 21 ms
9,272 KB
testcase_22 AC 33 ms
10,396 KB
testcase_23 AC 44 ms
13,820 KB
testcase_24 AC 73 ms
16,208 KB
testcase_25 AC 71 ms
18,920 KB
testcase_26 AC 98 ms
18,992 KB
testcase_27 AC 49 ms
18,984 KB
testcase_28 AC 50 ms
18,816 KB
testcase_29 AC 97 ms
19,000 KB
testcase_30 AC 97 ms
18,844 KB
testcase_31 AC 69 ms
18,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# yukicoder No.406 鴨等間隔の法則

N = int(input())
X = [int(x) for x in input().split()]
X.sort()
ans = "YES"

for i in range(N):
    if i == 1:
        interval = X[i] - X[i - 1]

        if interval == 0:
            ans = "NO"
            break
    elif i > 1:
        if X[i] - X[i - 1] != interval:
            ans = "NO"
            break

print(ans)
0