結果

問題 No.3286 Make a Happy Connection
ユーザー manta1130
提出日時 2025-10-04 22:14:50
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 242 bytes
コンパイル時間 296 ms
コンパイル使用メモリ 12,160 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2025-10-04 22:14:53
合計ジャッジ時間 2,742 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split(" ")))

flag=False

if N==2 and A[0]==A[1]:
  flag=True

for i in range(0,N-1):
  if i != N-2 and A[i]==A[i+2] or A[i]==A[i+1]:
    flag=True
    break

if flag:
  print("Yes")
else:
  print("No")

0