結果

問題 No.3286 Make a Happy Connection
ユーザー programogumogu
提出日時 2025-10-19 22:35:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 247 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 82,596 KB
実行使用メモリ 54,208 KB
最終ジャッジ日時 2025-10-19 22:35:45
合計ジャッジ時間 2,597 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = [int(x) for x in input().split()]
fl = False
for i in range(n-1):
	if a[i] == a[i+1]:
		fl = True
	if 0 < i and a[i-1] == a[i+1]:
		fl = True
	if i < n-2 and a[i] == a[i+2]:
		fl = True

if fl:
	print("Yes")
else:
	print("No")
0