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 |
---|---|---|---|---|---|---|
1688 | Codeforces Round 796 (Div. 2) | FINISHED | False | 7200 | 82999463 | June 3, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 8292 ) | C | Manipulating History | PROGRAMMING | math strings |
B'Keine has the ability to manipulate history. The history of Gensokyo is a string s of length 1 initially. To fix the chaos caused by Yukari, she needs to do the following operations n times, for the i -th time: Note that if t_{2i-1} occurs more than once in s , exactly one of them will be replaced. For example, let s= "marisa", t_{2i-1}= "a", and t_{2i}= "z". After the operation, s becomes "mzrisa" or "marisz". After n operations, Keine got the final string and an operation sequence t of length 2n . Just as Keine thinks she has finished, Yukari appears again and shuffles the order of t . Worse still, Keine forgets the initial history. Help Keine find the initial history of Gensokyo! Recall that a substring is a sequence of consecutive characters of the string. For example, for string "abc" its substrings are: "ab", "c", "bc" and some others. But the following strings are not its substring: "ac", "cba", "acb". Hacks You cannot make hacks in this problem. Each test contains multiple test cases. The first line contains a single integer T ( 1 <= q T <= q 10^3 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n < 10 ^ 5 ) -- the number of operations. The next 2n lines contains one non-empty string t_{i} -- the i -th string of the shuffled sequence t . The next line contains one non-empty string s -- the final string. It is guaranteed that the total length of given strings (including t_i and s ) over all test cases does not exceed 2 cdot 10 ^ 5 . All given strings consist of lowercase English letters only. It is guaranteed that the initial string exists. It can be shown that the initial string is unique. For each test case, print the initial string in one line. Test case 1: Initially s is "a". So the final string is "a'... |
Tutorial |
No solutions yet.