#C. CS240 project Problem 3

    传统题 1000~1500ms 256MiB

CS240 project Problem 3

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

Phone Number

题目描述

You are given a phone number f1..nf_{1..n}​. Based on this number, generate a new number g1..ng_{1..n}.

The generation rule is that g1g_1 can be any digit from 0 to 9, and the subsequent g2..ng_{2..n} 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 0 0 to 9 9 f1..nf_{1..n}. The sequence length does not exceed 50 50 .

输出格式

Output the single number — the number of phone numbers.

样例 #1

样例输入 #1

12345

样例输出 #1

48

样例 #2

样例输入 #2

09

样例输出 #2

15

CS240 2024 Spring Project Problem

未参加
状态
已结束
规则
IOI
题目
4
开始于
2024-5-30 17:00
结束于
2024-6-24 23:59
持续时间
607 小时
主持人
参赛人数
99