| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 11567 | Hexadecimal to Binary |
|
| 11598 | Word rotation |
|
| 11611 | Addition and Division of Big Number |
|
Description
Please try to add 2 hexadecimal numbers, and give the answer as binary number.
EX: Given A and B, we know that A represents 10 and B represents 11 in decimal, 10 + 11 = 21.
21 is 10101 in binary form , so the answer is 10101.
Hint: You can use %x to read hexadecimal numers :)
(Reference) Below is Acsii Table:

Input
Two hexadecimal numbers X and Y.
Output
The sum of X and Y in binary form.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Given a string with length L < 1001 and only containing capital letters, lower letters and digits, please output the result of rotating the word for one time, and repeat doing so for L times.
Suppose the original string is ab1cde , after rotating for one time, the result will be b1cdea.
That is, the operator of rotating for one time is to move the first letter of the string to the tail of the string.
Input
There is only one line in the input, which is a string only containing capital letters, lower letters and digits.
The length of the string L < 1001.
Output
Output the result of rotating the word for one time, and repeat doing so for L times. The last line is the original string. Remember to print the endline character.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
As we all know, all kinds of data type like int, long, etc have their limitation in representing numbers.
For instance, if we use int to store some variable, it may not contain the value we want if the variable is bigger than 231, which is roughly the same as 2 * 109.
So it would get into trouble if we want to calculate some very large number, like 101000 + 1.
In this task, you are asked to implement a calculator that can make some simple calculation of big number possible.
For simplifying the question, we will give you several data groups containing two big numbers a and b, and a integer divisor c. For each group, all we need is the integer part of (a + b)/c.
Hint:
You can recall the very first experiment you learned addition. At that time the teacher may tell you that you should calculate the addition in each digit , only maintain the very right digit as the answer and send the others as the carry to the next digit. For instance, if we want to calculate 999 + 999, the following method might be well:
9 9 9
9 9 9
+
-------
8 8 8 (right most digit)
1 1 1 (carry)
+
--------
1 9 9 8
You may use int array to record the big number and the upper method to calculate.
For division, you can also use some likely method.
We do the division from the very left digit of dividend(被除數) , calculate the result and pass the reminder to the right digit.
For instance, if we want to calculate 199 / 2:
9 9
——————
2 )1 9 9
1 8
————————
1 9
1 8
————————
1
Characters in red are reminders.
Other better method is encouraged.
Input
The input contains several lines.
The very first line is a integer N representing the total times of calculation. (1 <= N < 50)
From the second line to the last line, each three lines forms a group representing a calculation.
The first line and the second line of each group are two numbers, which are in decimal, bigger than or equal to 0 and smaller than 101000. For making the question easier, the lengths of the two numers are just the same. It is possibe for the numbers beginning with 0.
The third line of each group is the divisor (bigger than 0 and smaller than 231-1).
Output
The answer of each group.
Please do not pad 0 in your answer. Eg 87 is a legel answer but 087 is illegal.
You should add a newline at the end of the answer.