結果

問題 No.2283 Prohibit Three Consecutive
ユーザー miho-4miho-4
提出日時 2023-04-28 23:42:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 220 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 78,208 KB
最終ジャッジ日時 2024-04-29 00:45:00
合計ジャッジ時間 1,904 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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