結果

問題 No.2283 Prohibit Three Consecutive
ユーザー Alex WiceAlex Wice
提出日時 2023-04-28 22:33:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 231 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 77,056 KB
最終ジャッジ日時 2024-04-29 00:01:10
合計ジャッジ時間 1,966 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 42 ms
51,456 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 44 ms
52,480 KB
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(n, s):
	t = s + s
	if '111' in t or '000' in t:
		return False
	if '11?00' or '00?11' in t:
		return False
	return True

for tc in range(int(input())):
	n = int(input())
	s = input()
	print("Yes" if solve(n, s) else "No")
0