#P2104. 二进制
二进制
Description
Xiao Z recently learned about binary numbers. He thinks very small binary numbers are boring, so he wants to perform the following basic operations on a huge binary number:
Operation : Add to the entire binary number.
Operation : Subtract from the entire binary number.
Operation : Multiply the entire binary number by .
Operation : Integer divide the entire binary number by .
Xiao Z really wants to know the result after the operations, so he asks you for help.
(P.S.: To simplify the problem, the testdata guarantees that the + and - operations will not cause a carry-out or a borrow at the most significant bit.)
Input Format
The first line contains two positive integers , representing the length of the original binary number and the number of operations.
The second line contains characters, each being 0 or 1, representing this binary number.
The third line contains characters, each being one of +, -, *, /, corresponding to operations .
Output Format
Output one line with some characters, representing the binary number after performing the operations.
4 10
1101
*/-*-*-/*/
10110
Hint
Constraints:
For of the testdata, .
For of the testdata, .
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号