結果
| 問題 | No.3286 Make a Happy Connection |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2025-10-03 22:39:55 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 34 ms / 2,000 ms |
| + 174µs | |
| コード長 | 402 bytes |
| 記録 | |
| コンパイル時間 | 94 ms |
| コンパイル使用メモリ | 64,272 KB |
| 実行使用メモリ | 53,888 KB |
| 最終ジャッジ日時 | 2026-10-17 00:55:41 |
| 合計ジャッジ時間 | 3,103 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
from itertools import pairwise
N = int(input())
A = list(map(int, input().split()))
def solve():
for a, b in pairwise(A):
if a == b:
return True
for i in range(N):
if i+2 < N and A[i] == A[i+2]:
return True
if i > 0 and A[i-1] == A[i]:
return True
return False
ans = solve()
if ans:
print('Yes')
else:
print('No')
norioc