Здравейте, опитвам да реша две от задачите, но зациклих сериозно. Всякакви насоки са добре дошли. Поздрави!
Signal from Space
One day a signal from space was registered. Scientists managed to record the signal as a sequence of N
symbols. It turned out that due to a technical difficulty some symbols have been repeated. Help the scientists by writing a program which removes consecutive repetitions of symbols, decoding the message.
Input
Input data is read from the standard input
- On the only input line, a message is given
Output
Print to the standard output
- Print the decoded message
Constraints
- The length of the message will be no more than
10000
symbols - Message consists of digits and Latin letters (upper and lower case)
Input
Hello
Output
Helo
import java.util.*; import java.util.ArrayList; import java.util.Scann - Pastebin.com
“Good” numbers
Description
Ivancho considers a number to be “good”, if it can be divided by each of its digits.
For example:
- 13 is not “good”, because it cannot be divided by 3;
- 36 is “good”, because it can be divided both by 3 and 6;
- 102 is “good” - can be divided by 1 and by 2;
- 103 is not “good” - cannot be divided by 3;
Help Ivancho by writing a program, which counts the “good” numbers between number A and number B (inclusive).
Input
Read from the standard input the numbers A and B received on one line, separated by space.
Output
Print to the standard output the count of “good” numbers.
Constraints
- 1 <= A <= B <= 100000
Examples
Input
1 10
Output
10
Explanation - between 1 and 10 there are 10 “good” numbers
Input
42 142
Output
29
Input
256 768
Output
50