結果

問題 No.2343 (l+r)/2
ユーザー prussian_coderprussian_coder
提出日時 2023-06-11 08:00:23
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 379 bytes
コンパイル時間 723 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 85,636 KB
最終ジャッジ日時 2023-08-31 01:50:12
合計ジャッジ時間 3,326 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,324 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 AC 78 ms
77,624 KB
testcase_05 AC 74 ms
72,972 KB
testcase_06 AC 71 ms
72,236 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 82 ms
81,644 KB
testcase_13 AC 78 ms
78,812 KB
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
def solve():
	N=int(input())
	S=input().split()
	if S[0]!=S[-1]:
		return True
	else:
		for i in range(N-1):
			if S[i]!=S[i+1]:
				l=i+1
				break
		for i in reversed(range(N-1)):
			if S[i+1]!=S[i]:
				r=i+1
				break
		X="".join(S[l:r])
		if "00" in X or "11" in X:
			return True
		else:
			return False
		
for _ in range(T):
	print(["No","Yes"][solve()])

	
0