Time Limit: 2 Seconds Memory Limit: 65536 KBGiven a positive integer n, print out the positions of all 1's in its binary representation. The position of the least significant bit is 0.Example The positions of 1's in the binary representation
Time Limit: 2 Seconds Memory Limit: 65536 KBFor 2 non-negative integers x and y, f(x, y) is defined as the number of different bits in the binary format of x and y. For example, f(2, 3)=1, f(0, 3)=2, f(5, 10)=4.Now given 2 sets of non-negative
Time Limit: 2 Seconds Memory Limit: 65536 KBA certain prison contains a long hall of n cells, each right next to each other. Each cell has a prisoner in it, and each cell is locked.One night, the jailer gets bored and decides to play a game.
Time Limit: 2 Seconds Memory Limit: 65536 KB A group of n gamblers decide to play a game: At the beginning of the game each of them will cover up his wager on the table and the assitant must make sure that there are no two gamblers have put the
Time Limit: 2 Seconds Memory Limit: 65536 KBWhen a number is expressed in decimal, the kth digit represents a multiple of 10 k. (Digits are numbered from right to left, where the least significant digit is number 0.) For example,81307(10) = 8 *
Time Limit: 2 Seconds Memory Limit: 65536 KBMathematics can be so easy when you have a computer. Consider the following example. You probably know that in a right-angled triangle, the length of the three sides a, b, c (where c is the longest
Daffodil numberTime Limit: 1 Second Memory Limit: 32768 KBThe daffodil number is one of the famous interesting numbers in the mathematical world. A daffodil number is a three-digit number whose value is equal to the sum of cubes of each
Time Limit: 2 Seconds Memory Limit: 65536 KBMs. Terry is a pre-school art teacher who likes to have her students work with clay. One of her assignments is to form a lump of clay into a block and then measure the dimensions of the block. However,
Time Limit: 10 Seconds Memory Limit: 32768 KBIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are given a number, you
Time Limit: 2 Seconds Memory Limit: 65536 KBSoundex coding groups together words that appear to sound alike based on their spelling. For example, "can" and "khawn", "con" and "gone" would be equivalent under Soundex coding. Soundex coding
Time Limit: 2 Seconds Memory Limit: 65536 KBTan Your Hide, Inc., owns several coin-operated tanning salons. Research has shown that if a customer arrives and there are no beds available, the customer will turn around and leave, thus costing the
Time Limit: 2 Seconds Memory Limit: 65536 KBLittle Bob likes playing with his box of bricks. He puts the bricks one upon another and builds stacks of different height. ``Look, I've built a wall!'', he tells his older sister Alice. ``Nah, you
Time Limit: 2 Seconds Memory Limit: 65536 KBA sequence of n > 0 integers is called a jolly jumper if the absolute values of the difference between successive elements take on all the values 1 through n-1. For instance,1 4 2 3is a jolly
Time Limit: 10 Seconds Memory Limit: 32768 KBWe all know that FatMouse doesn't speak English. But now he has to be prepared since our nation will join WTO soon. Thanks to Turing we have computers to help him.Input SpecificationInput consists of
Time Limit: 2 Seconds Memory Limit: 65536 KBGiven an positive integer A (1 <= A <= 100), output the lowest bit of A.For example, given A = 26, we can write A in binary form as 11010, so the lowest bit of A is 10, so the output should be 2.
Time Limit: 2 Seconds Memory Limit: 65536 KBAn inch worm is at the bottom of a well n inches deep. It has enough energy to climb u inches every minute, but then has to rest a minute before climbing again. During the rest, it slips down d inches.