結果

問題 No.406 鴨等間隔の法則
ユーザー 双六双六
提出日時 2020-07-23 04:55:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 144 ms / 2,000 ms
コード長 494 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 93,044 KB
最終ジャッジ日時 2023-09-05 14:09:47
合計ジャッジ時間 6,377 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
82,276 KB
testcase_01 AC 100 ms
71,392 KB
testcase_02 AC 97 ms
71,752 KB
testcase_03 AC 98 ms
71,544 KB
testcase_04 AC 133 ms
90,348 KB
testcase_05 AC 116 ms
81,128 KB
testcase_06 AC 114 ms
80,488 KB
testcase_07 AC 114 ms
81,280 KB
testcase_08 AC 132 ms
90,736 KB
testcase_09 AC 137 ms
93,044 KB
testcase_10 AC 120 ms
82,864 KB
testcase_11 AC 134 ms
89,212 KB
testcase_12 AC 122 ms
83,932 KB
testcase_13 AC 117 ms
82,968 KB
testcase_14 AC 134 ms
90,716 KB
testcase_15 AC 101 ms
76,904 KB
testcase_16 AC 109 ms
78,000 KB
testcase_17 AC 107 ms
77,528 KB
testcase_18 AC 107 ms
77,676 KB
testcase_19 AC 106 ms
77,828 KB
testcase_20 AC 106 ms
77,632 KB
testcase_21 AC 110 ms
78,164 KB
testcase_22 AC 111 ms
78,352 KB
testcase_23 AC 124 ms
85,084 KB
testcase_24 AC 129 ms
88,816 KB
testcase_25 AC 140 ms
92,816 KB
testcase_26 AC 139 ms
92,792 KB
testcase_27 AC 122 ms
91,640 KB
testcase_28 AC 127 ms
92,940 KB
testcase_29 AC 143 ms
92,820 KB
testcase_30 AC 142 ms
92,596 KB
testcase_31 AC 144 ms
92,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# import sys; input = sys.stdin.buffer.readline
# sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N = int(input())
	X = getlist()
	X.sort()
	D = defaultdict(int)
	for i in range(N - 1):
		if X[i + 1] - X[i] == 0:
			print("NO")
			return
		D[X[i + 1] - X[i]] += 1

	if len(D) >= 2:
		print("NO")
	else:
		print("YES")



if __name__ == '__main__':
	main()
0