結果

問題 No.2283 Prohibit Three Consecutive
ユーザー miho-4
提出日時 2023-04-28 23:36:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 211 bytes
コンパイル時間 318 ms
コンパイル使用メモリ 82,272 KB
実行使用メモリ 77,560 KB
最終ジャッジ日時 2024-11-17 22:28:07
合計ジャッジ時間 1,881 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 7 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
for _ in range(T):
  n=int(input())
  s=input()
  x=s[-2:]+s+s[:2]
  flag=1
  S={"111","000","11?00","00?11"}
  for e in S:
    if e in x:
      flag=0
      break
  print("Yes" if flag else "No")
0