結果

問題 No.406 鴨等間隔の法則
ユーザー Subaru314Subaru314
提出日時 2021-02-13 01:06:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,536 KB
実行使用メモリ 19,040 KB
最終ジャッジ日時 2023-09-27 08:30:54
合計ジャッジ時間 4,041 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
12,628 KB
testcase_01 AC 14 ms
7,968 KB
testcase_02 AC 16 ms
8,144 KB
testcase_03 AC 15 ms
8,052 KB
testcase_04 AC 60 ms
17,992 KB
testcase_05 AC 30 ms
11,524 KB
testcase_06 AC 32 ms
11,868 KB
testcase_07 AC 31 ms
11,960 KB
testcase_08 AC 59 ms
18,484 KB
testcase_09 AC 62 ms
18,924 KB
testcase_10 AC 32 ms
12,300 KB
testcase_11 AC 48 ms
16,412 KB
testcase_12 AC 36 ms
13,552 KB
testcase_13 AC 34 ms
12,888 KB
testcase_14 AC 74 ms
17,064 KB
testcase_15 AC 16 ms
8,716 KB
testcase_16 AC 17 ms
8,904 KB
testcase_17 AC 16 ms
8,472 KB
testcase_18 AC 16 ms
8,912 KB
testcase_19 AC 18 ms
9,056 KB
testcase_20 AC 21 ms
9,368 KB
testcase_21 AC 19 ms
9,340 KB
testcase_22 AC 30 ms
10,400 KB
testcase_23 AC 38 ms
13,752 KB
testcase_24 AC 63 ms
15,824 KB
testcase_25 AC 59 ms
18,864 KB
testcase_26 AC 79 ms
18,992 KB
testcase_27 AC 41 ms
19,040 KB
testcase_28 AC 41 ms
18,948 KB
testcase_29 AC 80 ms
18,956 KB
testcase_30 AC 81 ms
18,884 KB
testcase_31 AC 60 ms
18,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
l = list(map(int,input().split()))

l.sort()
s = l[1]-l[0]

if s == 0:
    print("NO")
    exit()
else:
    for i in range(n-2):
        if l[i+2]-l[i+1] != s:
            print("NO")
            exit()
        else:
            pass

    print("YES")

0