結果

問題 No.2283 Prohibit Three Consecutive
ユーザー 👑 p-adicp-adic
提出日時 2023-06-05 13:15:07
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 261 bytes
コンパイル時間 257 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 81,252 KB
最終ジャッジ日時 2023-08-28 09:31:13
合計ジャッジ時間 4,878 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,460 KB
testcase_01 AC 70 ms
71,580 KB
testcase_02 AC 70 ms
71,480 KB
testcase_03 AC 121 ms
77,288 KB
testcase_04 AC 125 ms
76,816 KB
testcase_05 AC 219 ms
79,232 KB
testcase_06 RE -
testcase_07 AC 67 ms
71,212 KB
testcase_08 AC 996 ms
80,992 KB
testcase_09 AC 95 ms
76,880 KB
testcase_10 AC 97 ms
76,824 KB
testcase_11 AC 100 ms
76,896 KB
testcase_12 RE -
testcase_13 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

I=input
O='1'
for n in range(int(I())):
	N,S,f=I(),I(),0
	T=[[S,i][S[0]>O][0]+[S,i][S[1]>O][1]for i in["00","01","10","11"]]
	for t in T:
		a=b=c=d=1
		for s in t+S[2:]+t:a,b,c,d=c*(s!=O),(a+c)*(s>=O),(b+d)*(s!=O),b*(s>=O)
		f+=a+b+c+d
	print(["No","Yes"][f>0])
0