| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 11127 | Binary representation&sum |
|
| 11561 | Point distance |
|
| 12009 | Caesar salad |
|
| 12013 | multiplication |
|
Description
Problem Description
Given a positive integer N, transform it to its unsigned binary representation (e.g. 10 => 1010). Your program needs to output the binary representation of N+1 and the number of carries during the addition in binary representation.
For example, if the input is 11 (in decimal), your program needs to output 1100, because it is the binary representation of 11+1=12. Also your program needs to output 2, because during the binary addition of 11+1, there are two carries generated.
1011 (11 in binary)
+ 0001 (1 in binary)
---------------------------------
1100 (12 in binary)
Input
The input consist of an integer N (0 <= N <= 1024)
Output
The binary representation of N+1 and the number of carries during the binary addition of N+1. Those two numbers are separated by a space. Note that you do not need to print ‘\n’ at the end of the output.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
The purpose of programming is to solve complicated problems that humans are not able to solve quickly.
In the xy-coordinate system, there are a given line and a given point on the plane. The task is to print out the square of the shortest distance from the point to the line.

Input

Output
Please output the square of the distance from the point P to the line L with a new line. Note that the answer should be rounded to the second decimal place.
You can use printf(“%.2f\n", your_ans) to print out your answer. Remember that your_ans has to be in double type.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Caesar wants to eat salad, but nobody sells salad within his country. Thus, he decides to write a letter to the businessmen outside his country. But to secure his message, he has to encrypt the content of his letter.
The encrypt rule is as follow: For each English character inside his letter, shift it with a fixed number n in positive/negative direction.
For example,
- n = 2, then "IJK" will become "KLM"
- n = 3, then "IJK" will become "LMN"
- n = -2, then "AJK" will become "YHI"
- We do the shifting in a cyclic manner, that is, perform left shift 1 on "A" will become "Z"; right shift 2 on "Y" will become "A"
Actually, this encryption is the well-known Caesar chiper.
Input
Input consists of three UPPERCASE English characters and an integer n, seperated by a whitespace character.
The three uppercase English characters is the Caesar's message, n is the shift amount mentioned above (positive for right shift, negative for left shift).
It is guaranteed that -2147483648 <= n <= 2147483647.
Output
Print Caesar's message after encryption (three UPPERCASE English character).
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Cookie multiplication
Jane has two types of cookies (of number N and M, respectively), and she uses a magic spell to produce more cookies (N * M in total).
However, there are many cookies. Jane asks you to help her calculate the number of new cookies she can make.
Input
3 integers K, N, M in order.
N , M means the number of cookies.
If the digits of new cookies is smaller than K,
please left pad with zeros up to K digits.
Data range:
0 <= N, M <= 2^32-1
1 <= K <= 1000000
Output
Output a single line with the number N * M, and a '\n' at the end.
Hint: overflow , printf skill
printf()
If you don't know how to search more information, you can look at this reference.
It really helps.
http://www.cplusplus.com/reference/cstdio/printf