CS240 project Problem 3
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Phone Number
题目描述
You are given a phone number . Based on this number, generate a new number .
The generation rule is that can be any digit from 0 to 9, and the subsequent are generated according to the following rule:
$$g_{i}\leftarrow\left\lfloor\frac{f_i+g_{i-1}}{2}\right\rfloor \text{or} \left\lceil\frac{f_i+g_{i-1}}{2}\right\rceil $$Note: The generated numbers must not be the same as the old numbers.
输入格式
The first line contains nonempty sequence consisting of digits from to — . The sequence length does not exceed .
输出格式
Output the single number — the number of phone numbers.
样例 #1
样例输入 #1
12345
样例输出 #1
48
样例 #2
样例输入 #2
09
样例输出 #2
15
CS240 2024 Spring Project Problem
- Status
- Done
- Rule
- IOI
- Problem
- 4
- Start at
- 2024-5-30 17:00
- End at
- 2024-6-24 23:59
- Duration
- 607 hour(s)
- Host
- Partic.
- 99