結果

問題 No.406 鴨等間隔の法則
ユーザー nbisconbisco
提出日時 2017-01-14 15:46:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 348 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 10,668 KB
実行使用メモリ 19,100 KB
最終ジャッジ日時 2023-09-21 18:20:38
合計ジャッジ時間 2,629 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
12,484 KB
testcase_01 AC 15 ms
7,740 KB
testcase_02 AC 14 ms
7,876 KB
testcase_03 AC 15 ms
7,792 KB
testcase_04 AC 59 ms
17,972 KB
testcase_05 AC 31 ms
11,564 KB
testcase_06 AC 31 ms
11,872 KB
testcase_07 AC 31 ms
11,940 KB
testcase_08 AC 60 ms
18,440 KB
testcase_09 AC 67 ms
18,872 KB
testcase_10 AC 33 ms
12,432 KB
testcase_11 AC 50 ms
16,496 KB
testcase_12 AC 39 ms
13,556 KB
testcase_13 AC 36 ms
12,920 KB
testcase_14 AC 66 ms
17,020 KB
testcase_15 AC 17 ms
8,760 KB
testcase_16 AC 17 ms
8,824 KB
testcase_17 AC 15 ms
8,568 KB
testcase_18 AC 16 ms
8,852 KB
testcase_19 AC 19 ms
9,036 KB
testcase_20 AC 21 ms
9,408 KB
testcase_21 AC 20 ms
9,416 KB
testcase_22 AC 27 ms
10,532 KB
testcase_23 AC 39 ms
13,804 KB
testcase_24 AC 58 ms
15,892 KB
testcase_25 AC 64 ms
18,824 KB
testcase_26 AC 76 ms
19,068 KB
testcase_27 AC 43 ms
19,072 KB
testcase_28 AC 42 ms
18,960 KB
testcase_29 AC 74 ms
19,100 KB
testcase_30 AC 76 ms
18,792 KB
testcase_31 AC 61 ms
18,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    x = sorted(map(int, input().split(" ")))

    dist = x[1] - x[0]
    for i in range(len(x)-1):
        if x[i] == x[i+1]:
            print("NO")
            return
        tmp = x[i+1] - x[i]
        if dist != tmp:
            print("NO")
            return
        dist = tmp
    print("YES")        

main()
0