|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|2 초||512 MB||1||1||1||100.000%|
Russia is known for its success in the field of space exploration. Recently Russian scientists analysed the samples of Martian soil, and found some strange molecule, which they believe can be some kind of DNA. This molecule has only two base elements instead of the four bases in the normal DNA. So the whole molecule can be described as string of zeroes and ones.
The scientists computed the length of the molecule, it is n base elements. Now they want to determine its structure, i.e. find the string of ones and zeroes S, that encodes the elements of the DNA molecule. In order to do it, they can make tests in a special DNA analyser. In each test they set a sequence of elements, encoded by string P, and the analyser checks if this sequence appears in the molecule, i.e. if the string P is a substring of S.
The sample is very fragile, so the scientists will be able to make only t tests. Help them make correct tests to determine the structure of the DNA sequence.
You should implement one function (method):
string analyse(int n, int t). This function should make the tests using the library function (method)
make_testand resolve the DNA.
n: length of the DNA sequence.
t: number of tests allowed.
Sdescribing the DNA sequence.
bool make_test(string p). This function checks whether the string P is a substring of S.
p: substring to test.
trueif P is a substring of S,
Please use the provided template files for details of implementation in your programming language.
The grader makes the following function call:
analyse(3, 7). The length of string S is 3, you are alllowed to make 7 tests.
The contestant's program makes the following function calls:
Now the only possible string is
"101", so the function
n ≤ 5, t = 31.
n ≤ 100, t = 256.
n ≤ 1000, t = 1024.
The sample grader reads the input in the following format:
C++17, C++14, C++20, C++14 (Clang), C++17 (Clang), C++20 (Clang)