結果

問題 No.406 鴨等間隔の法則
ユーザー mlihua09mlihua09
提出日時 2020-08-27 19:45:01
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 200 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 86,996 KB
実行使用メモリ 91,384 KB
最終ジャッジ日時 2023-08-07 20:24:51
合計ジャッジ時間 5,605 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
80,512 KB
testcase_01 AC 73 ms
71,160 KB
testcase_02 AC 69 ms
71,140 KB
testcase_03 AC 70 ms
71,216 KB
testcase_04 AC 102 ms
89,156 KB
testcase_05 AC 83 ms
79,236 KB
testcase_06 AC 83 ms
79,096 KB
testcase_07 AC 84 ms
79,760 KB
testcase_08 AC 103 ms
88,780 KB
testcase_09 AC 107 ms
90,620 KB
testcase_10 AC 85 ms
80,444 KB
testcase_11 AC 100 ms
87,056 KB
testcase_12 AC 89 ms
81,960 KB
testcase_13 AC 88 ms
81,552 KB
testcase_14 AC 110 ms
89,504 KB
testcase_15 AC 73 ms
75,564 KB
testcase_16 AC 74 ms
75,488 KB
testcase_17 AC 73 ms
75,492 KB
testcase_18 AC 74 ms
75,504 KB
testcase_19 AC 78 ms
76,272 KB
testcase_20 AC 78 ms
75,992 KB
testcase_21 AC 76 ms
75,488 KB
testcase_22 AC 82 ms
77,380 KB
testcase_23 AC 89 ms
82,660 KB
testcase_24 AC 99 ms
87,344 KB
testcase_25 AC 109 ms
91,052 KB
testcase_26 AC 110 ms
91,240 KB
testcase_27 AC 90 ms
90,200 KB
testcase_28 AC 92 ms
90,848 KB
testcase_29 AC 109 ms
91,384 KB
testcase_30 AC 110 ms
91,180 KB
testcase_31 AC 106 ms
90,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


N = int(input())

X = list(map(int, input().split()))

X.sort()

P = X[1] - X[0]

if P != 0 and all(X[i + 1] - X[i] == P for i in range(N - 1)):
    
    print('YES')
    
else:
    
    print('NO')
0