結果

問題 No.2283 Prohibit Three Consecutive
ユーザー ShirotsumeShirotsume
提出日時 2023-04-28 23:27:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 522 bytes
コンパイル時間 233 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 79,488 KB
最終ジャッジ日時 2024-04-29 00:36:24
合計ジャッジ時間 2,587 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
55,424 KB
testcase_01 AC 43 ms
55,680 KB
testcase_02 AC 42 ms
56,192 KB
testcase_03 AC 43 ms
57,088 KB
testcase_04 AC 44 ms
56,960 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 108 ms
65,408 KB
testcase_09 AC 113 ms
65,792 KB
testcase_10 AC 110 ms
65,536 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque, Counter
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353
import random
def solve():
    n = ii()
    s = input()
    for _ in range(50):
        x = random.randint(0, n)
        s = s[x:] + s[:x]
        if '000' in s or '111' in s or '00?11' in s or '11?00' in s:
            print('No')
            return
    print('Yes')


for _ in range(ii()):
    solve()
0