|
Time |
Memory |
Case 1 |
1 sec |
32 MB |
Case 2 |
1 sec |
32 MB |
Case 3 |
1 sec |
32 MB |
Case 4 |
1 sec |
32 MB |
Case 5 |
1 sec |
32 MB |
Case 6 |
1 sec |
32 MB |
Case 7 |
1 sec |
32 MB |
Case 8 |
1 sec |
32 MB |
Description
There are interesting string operations there.
- a + b: Concatenate the string b after the string a.
- a - b: If string b has appeared in string a, delete the first appearance of b in a, otherwise output "error".
- a . b: Treat it as a floating-point number and round to six decimal places. If there are fewer than six decimal places, append '0' until reaching six decimal places.
- a @ b1_b2_b3_...bk: For all strings bi concatenated with '_', if a has appeared in string bi, add bi to a list, output the list in this order:
- If |x| > |y|: x is listed before y
- If |x| = |y|: follows the lexicographical order
Input
The first line contains an integer T, representing the number of string operations.
The following T lines each contain a string Si , representing the string operation in the i-th round.
Subtasks
- Testcases 1 ~ 2: 1 ≤ T ≤ 1000, 1 ≤ |S | ≤ 104, only "+" operation, a and b are guaranteed to consist of lowercase letters
- Testcases 3 ~ 4: 1 ≤ T ≤ 1000, 1 ≤ |S | ≤ 104, "+, -" operations, a and b are guaranteed to consist of lowercase letters
- Testcases 5 ~ 6: 1 ≤ T ≤ 1000, 1 ≤ |S | ≤ 104, "+, -, ." operations, a and b are guaranteed to consist of lowercase letters and digits
- Testcases 7 ~ 8: 1 ≤ T ≤ 1000, 1 ≤ |S | ≤ 5*104, only "@" operation, a and b are guaranteed to consist of lowercase letters and "_"
Output
Output T lines, each containing a string Si after operation.
Please remember to print "\n" at the end.
Tags