結果

問題 No.406 鴨等間隔の法則
ユーザー TatsunoTatsuno
提出日時 2016-08-05 22:28:44
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 19,096 KB
最終ジャッジ日時 2023-09-21 17:41:12
合計ジャッジ時間 2,944 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
12,544 KB
testcase_01 AC 14 ms
7,760 KB
testcase_02 AC 14 ms
7,896 KB
testcase_03 AC 13 ms
7,800 KB
testcase_04 AC 60 ms
17,956 KB
testcase_05 AC 29 ms
11,556 KB
testcase_06 AC 31 ms
11,912 KB
testcase_07 AC 31 ms
11,940 KB
testcase_08 AC 59 ms
18,440 KB
testcase_09 AC 63 ms
18,792 KB
testcase_10 AC 34 ms
12,336 KB
testcase_11 AC 53 ms
16,380 KB
testcase_12 AC 38 ms
13,476 KB
testcase_13 AC 37 ms
13,020 KB
testcase_14 AC 74 ms
17,144 KB
testcase_15 AC 17 ms
8,696 KB
testcase_16 AC 17 ms
8,960 KB
testcase_17 AC 16 ms
8,508 KB
testcase_18 AC 16 ms
8,728 KB
testcase_19 AC 19 ms
9,008 KB
testcase_20 AC 22 ms
9,356 KB
testcase_21 AC 19 ms
9,232 KB
testcase_22 AC 29 ms
10,496 KB
testcase_23 AC 39 ms
13,760 KB
testcase_24 AC 66 ms
15,920 KB
testcase_25 AC 64 ms
18,896 KB
testcase_26 AC 86 ms
19,096 KB
testcase_27 AC 62 ms
19,080 KB
testcase_28 AC 44 ms
18,768 KB
testcase_29 AC 86 ms
19,040 KB
testcase_30 AC 83 ms
18,948 KB
testcase_31 AC 62 ms
18,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
x=list(sorted(map(int,input().split())))
d=x[1] - x[0]
ok = True
for i in range(n-1):
    if x[i+1] - x[i] != d:
        ok = False
        break
print("YES" if ok and d>0 else "NO")
0