| University of Science and Technology of China Freshman Programming Contest 2026(2026 Kruskal Cup) |
|---|
| Закончено |
This is an interactive problem.
There is an unknown sequence $$$B$$$ consisting of $$$0$$$s and $$$1$$$s, with 1-based indexing. You can make multiple queries. In each query, you specify a center $$$m$$$ and a radius $$$r$$$, and the interactor will return the number of $$$1$$$s in the punctured neighborhood of indices $$$[m-r,m+r]\setminus\{m\}$$$ of $$$B$$$. Try to determine the total number of $$$1$$$s in $$$B$$$.
Note that the interval you query must not exceed the boundaries of the sequence itself.
There are multiple test cases in this problem.
First, read a line containing a single positive integer $$$T$$$ $$$(1\le T\le1000)$$$, denoting the number of test cases.
For each test case:
The number of queries for each test case must not exceed $$$35$$$.
Violations such as an incorrect interaction format or exceeding the query limit will result in an undefined verdict.
2 4 1 1 5 4 2
? 2 1 ? 3 1 ! 2 ? 3 2 ? 2 1 ! 5
The example demonstrates a possible interaction process. The unknown sequences in the two test cases are 1100 and 11111, respectively.
How to flush the output buffer:
| Название |
|---|


