{"problem":{"name":"Continuous 1","description":{"content":"You are given a string of length $N$, $S=S_1S_2\\dots S_N$, consisting of `0`, `1`, and `?`. We like to replace every `?` with `0` or `1` so that all of the following conditions are satisfied. *   $S$","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc150_a"},"statements":[{"statement_type":"Markdown","content":"You are given a string of length $N$, $S=S_1S_2\\dots S_N$, consisting of `0`, `1`, and `?`.\nWe like to replace every `?` with `0` or `1` so that all of the following conditions are satisfied.\n\n*   $S$ contains exactly $K$ occurrences of `1`.\n*   These $K$ occurrences of `1` are consecutive. That is, there is an $i\\ (1 \\leq i \\le N-K+1)$ such that $S_i=S_{i+1}=\\dots=S_{i+K-1}=$ `1`.\n\nDetermine whether there is exactly one way to replace the characters to satisfy the conditions.\nYou have $T$ test cases to solve.\n\n## Constraints\n\n*   $1 \\leq T \\leq 10^5$\n*   $1 \\leq K < N \\leq 3 \\times 10^5$\n*   $S$ is a string of length $N$ consisting of `0`, `1`, and `?`.\n*   The sum of $N$ across the test cases is at most $3 \\times 10^5$.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$T$\n$\\mathrm{case}_1$\n$\\vdots$\n$\\mathrm{case}_T$\n\nEach case is in the following format:\n\n$N$ $K$\n$S$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc150_a","tags":[],"sample_group":[["4\n3 2\n1??\n4 2\n?1?0\n6 3\n011?1?\n10 5\n00?1???10?","Yes\nNo\nNo\nYes\n\nFor the first test case, turning $S$ into `101`, for instance, does not satisfy the conditions since the `1`s will not be consecutive. The only way to satisfy the conditions is to turn $S$ into `110`.\nFor the second test case, we may turn $S$ into `1100` or `0110` to satisfy the conditions, so there are two ways to satisfy them.\nFor the third test case, there is no way to replace the characters to satisfy the conditions."]],"created_at":"2026-03-03 11:01:14"}}