結果

問題 No.406 鴨等間隔の法則
ユーザー ssmkzkssmkzk
提出日時 2018-06-13 03:04:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 274 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 18,964 KB
最終ジャッジ日時 2023-09-21 18:51:56
合計ジャッジ時間 3,275 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
12,560 KB
testcase_01 AC 16 ms
7,916 KB
testcase_02 AC 15 ms
7,768 KB
testcase_03 AC 15 ms
7,840 KB
testcase_04 AC 64 ms
18,060 KB
testcase_05 AC 32 ms
11,528 KB
testcase_06 AC 34 ms
11,884 KB
testcase_07 AC 34 ms
12,132 KB
testcase_08 AC 64 ms
18,336 KB
testcase_09 AC 69 ms
18,808 KB
testcase_10 AC 36 ms
12,280 KB
testcase_11 AC 56 ms
16,420 KB
testcase_12 AC 41 ms
13,536 KB
testcase_13 AC 39 ms
12,924 KB
testcase_14 AC 92 ms
17,072 KB
testcase_15 AC 18 ms
8,704 KB
testcase_16 AC 19 ms
8,960 KB
testcase_17 AC 18 ms
8,472 KB
testcase_18 AC 18 ms
8,824 KB
testcase_19 AC 22 ms
9,032 KB
testcase_20 AC 25 ms
9,464 KB
testcase_21 AC 22 ms
9,436 KB
testcase_22 AC 33 ms
10,460 KB
testcase_23 AC 43 ms
13,684 KB
testcase_24 AC 78 ms
15,828 KB
testcase_25 AC 70 ms
18,940 KB
testcase_26 AC 108 ms
18,908 KB
testcase_27 AC 77 ms
18,964 KB
testcase_28 AC 48 ms
18,924 KB
testcase_29 AC 107 ms
18,828 KB
testcase_30 AC 108 ms
18,896 KB
testcase_31 AC 66 ms
18,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
l = list(map(int, input().split()))
l.sort()
ck = l[1] - l[0] 
ck1 = 0
flg = 0
for i in range(len(l) - 1):
    ck1 = l[i + 1] - l[i]
    if ck1 != ck:
        flg = 1
        break
    ck = ck1

if ck == 0 or flg == 1:
    print("NO")
else:
    print("YES")
0