結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
51,840 KB
testcase_01 AC 41 ms
52,352 KB
testcase_02 AC 41 ms
51,968 KB
testcase_03 AC 45 ms
53,376 KB
testcase_04 AC 43 ms
53,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 43 ms
52,608 KB
testcase_09 AC 43 ms
52,736 KB
testcase_10 AC 43 ms
52,992 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[-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