結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,268 KB
testcase_01 AC 584 ms
78,548 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 76 ms
77,504 KB
testcase_05 AC 70 ms
72,512 KB
testcase_06 AC 72 ms
72,472 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 81 ms
81,572 KB
testcase_13 AC 77 ms
78,636 KB
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
def solve():
	N=int(input())
	S=input().split()
	l=-1
	r=-1
	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
		if l==-1 or r==-1:
			return False
		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