結果

問題 No.406 鴨等間隔の法則
ユーザー kawacchukawacchu
提出日時 2019-03-16 18:39:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 260 bytes
コンパイル時間 880 ms
コンパイル使用メモリ 10,684 KB
実行使用メモリ 18,920 KB
最終ジャッジ日時 2023-09-21 18:59:44
合計ジャッジ時間 2,897 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
12,424 KB
testcase_01 AC 16 ms
7,752 KB
testcase_02 AC 16 ms
7,900 KB
testcase_03 AC 16 ms
7,856 KB
testcase_04 AC 64 ms
17,912 KB
testcase_05 AC 32 ms
11,888 KB
testcase_06 AC 33 ms
11,904 KB
testcase_07 AC 34 ms
12,028 KB
testcase_08 AC 65 ms
18,320 KB
testcase_09 AC 68 ms
18,888 KB
testcase_10 AC 35 ms
12,512 KB
testcase_11 AC 57 ms
16,408 KB
testcase_12 AC 42 ms
13,504 KB
testcase_13 AC 40 ms
12,912 KB
testcase_14 AC 79 ms
16,988 KB
testcase_15 AC 17 ms
8,792 KB
testcase_16 AC 18 ms
9,020 KB
testcase_17 AC 16 ms
8,552 KB
testcase_18 AC 17 ms
8,808 KB
testcase_19 AC 21 ms
8,984 KB
testcase_20 AC 23 ms
9,400 KB
testcase_21 AC 21 ms
9,464 KB
testcase_22 AC 31 ms
10,408 KB
testcase_23 AC 43 ms
13,840 KB
testcase_24 AC 68 ms
15,920 KB
testcase_25 AC 69 ms
18,912 KB
testcase_26 AC 93 ms
18,788 KB
testcase_27 AC 48 ms
18,804 KB
testcase_28 AC 48 ms
18,920 KB
testcase_29 AC 95 ms
18,916 KB
testcase_30 AC 92 ms
18,796 KB
testcase_31 AC 66 ms
18,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
L = list(map(int,input().split()))
L = sorted(L)
d = L[1] - L[0]
if d == 0 :
    ans = "NO"
else :
    for i in range(1,N-1) :
        if d != (L[i+1] - L[i]) :
            ans = "NO"
            break
    else :
        ans = "YES"
print(ans)
0