| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 10097 | decimal to ternary |
|
| 11598 | Word rotation |
|
| 11632 | I2P_EECS_MID1_1 |
|
Description
Input two positive integers, X and Y. The task is to translate the decimal number X into Y digits ternary (三進位) number, and output the Y digits ternary number.
X is smaller than 1000 and Y is smaller than 8.
Input
Two positive integers, X and Y. X is smaller than 1000 and Y is smaller than 8.
Output
The Y digits ternary representation of the input number X.
Note that you need to print a '\n' at the end of the bit string.
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
Now you are in the World of Tanks !!!

Your mission is to follow the instructions and pick the coins : )
You will get a map of the world like this:

is your tank with size 3x3 (xox is the head of the tank), and $ represents a coin, # represents the wall, ^ represents the hill.
If your tank (3x3 body) is above the $, you will pick it up ($ can't be counted again). If # or ^ is in front of the tank (in front of the xox, tank's front part), you can not move. Coins' position does not overlap initial tank's position.
The tank has four forward directions (South, East, North, West). Its direction is where xox heads. Notice that the upper of the map is the North, and the initial direction of the tank is not always North.
And you will receive a sequence of instructions, which contains F (takes a step along the tank's head direction), R (tank's head turns right), and L (tank's head turns left). Instructions like R and L only change tank's head direction, and don't affect the tank's position (would not cause moving).
Your mission is to receive the instructions and drives the tanks in order to collect coins, and report the amount of coins you get in the end.
Notice: The sample input in the below seems not aligned because the size of each character is not identical. You can see the map above (it is the same as sample input) if you want to see clearly.
P.S: Kind professor HT Chen asks TA to give students a code template. You can follow codes below to just finish 5 functions above the main(), and you don't need to change any content in the main(). Or you can decide to write whole codes by yourself, it's up to you :)
Input
The first line of the input contains four things:
1. The rows of the map (0 < rows < 100)
2. The columns of the map (0 < cols < 100)
3. The total length of instructions (0 < instructions's length < 100)
4. The initial tank's direction (N, E, S, W)
The second line is the content of instructions.
For the next lines, they illustrate the map.
Output
The number of coins you get. (printf "\n" in the end)