2024-2025 ICPC, NERC, Southern and Volga Russian Regional Contest (Unrated, Online Mirror, ICPC Rules, Preferably Teams)

Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
2038 2024-2025 ICPC, NERC, Southern and Volga Russian Regional Contest (Unrated, Online Mirror, ICPC Rules, Preferably Teams) FINISHED False 18000 44479523 Nov. 18, 2024, 10:35 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 2944 ) G Guess One Character PROGRAMMING constructive algorithms interactive 1900

This is an interactive problem. You have to use flush operation right after printing each line. For example, in C++ you should use the function fflush(stdout) or cout.flush() , in Java or Kotlin — System.out.flush() , and in Python — sys.stdout.flush() . The jury has a string (s) consisting of characters 0 and/or 1 . The length of this string is (n). You can ask the following queries: (1) (t) — "how many times does (t) appear in (s) as a contiguous substring?" Here, (t) should be a string consisting of characters 0 and/or 1 ; its length should be at least (1) and at most (n). For example, if the string (s) is 111011 and the string (t) is 11 , the response to the query is (3). You have to guess at least one character in the string (s) by asking no more than (3) queries. Note that giving the answer does not count as a query. In every test and in every test case, the string (s) is fixed beforehand . Initially, the jury program sends one integer (t) ((1 \le t \le 1000)) — the number of test cases. At the start of each test case, the jury program sends one integer (n) ((2 \le n \le 50)) — the length of the string. After that, your program can submit queries to the jury program by printing the following line (do not forget to flush the output after printing a line!) : (1) (t) means asking a query "how many times does (t) appear in (s) as a contiguous substring?" For every query, the jury prints one integer on a separate line. It is either: the answer to your query, if the query is correct, and you haven't exceeded the query limit; or the integer (-1), if your query is incorrect (for example, the constraint (1 \le |t| \le n) is not met or the string (t) contains characters other than 0 and 1 ) or if you have asked too many queries while processing the current test case. To submit the answer, your program should send a line in the following format (do not forget

Tutorials

Submissions

No solutions yet.