結果

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

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
ans = False
if any(x == y for x, y in zip(a, a[1:])):
    ans = True
if n >= 3 and any(x == y for x, y in zip(a, a[2:])):
    ans = True
print('Yes' if ans else 'No')
0