CF495A.Digital Counter

普及-

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Malek lives in an apartment block with 100 floors numbered from 0 to 99. The apartment has an elevator with a digital counter showing the floor that the elevator is currently on. The elevator shows each digit of a number with 7 light sticks by turning them on or off. The picture below shows how the elevator shows each digit.

One day when Malek wanted to go from floor 88 to floor 0 using the elevator he noticed that the counter shows number 89 instead of 88. Then when the elevator started moving the number on the counter changed to 87. After a little thinking Malek came to the conclusion that there is only one explanation for this: One of the sticks of the counter was broken. Later that day Malek was thinking about the broken stick and suddenly he came up with the following problem.

Suppose the digital counter is showing number n. Malek calls an integer x (0 ≤ x ≤ 99) good if it's possible that the digital counter was supposed to show x but because of some(possibly none) broken sticks it's showing n instead. Malek wants to know number of good integers for a specific n. So you must write a program that calculates this number. Please note that the counter always shows two digits.

Malek 居住在一栋共有 100 层的公寓楼中,楼层编号从 0 到 99。公寓内有一部电梯,其数字显示屏会显示电梯当前所在的楼层。该显示屏使用 7 根发光棒(通过点亮或熄灭)来表示每个数字。下图展示了电梯如何显示各个数字:

某天,Malek 想乘电梯从 88 层前往 0 层,他注意到显示屏上显示的却是数字 89,而非 88。随后当电梯开始运行时,显示屏上的数字变为 87。经过一番思考,Malek 得出唯一可能的解释:显示屏中恰好有一根发光棒损坏了。当天晚些时候,Malek 思考着这根损坏的发光棒,忽然提出了如下问题:

假设数字显示屏当前显示的数字为 nn。Malek 称一个整数 xx(其中 0≤x≤990 \le x \le 99)是“好的”,如果存在某种(可能为空)损坏的发光棒集合,使得显示屏本应显示 xx,却因这些损坏而实际显示为 nn。Malek 想要知道对于给定的 nn,有多少个“好的”整数。因此,你需要编写一个程序来计算这个数目。请注意:该显示屏始终显示两位数字。

输入格式

The only line of input contains exactly two digits representing number n (0 ≤ n ≤ 99). Note that n may have a leading zero.

输入仅有一行,包含恰好两个数字,表示数字 nn(0 ≤ n ≤ 990 \leq n \leq 99)。注意:nn 可能带有前导零。

输出格式

In the only line of the output print the number of good integers.

在输出的唯一一行中打印好整数的个数。

输入输出样例

  • 输入#1

    89

    输出#1

    2
  • 输入#2

    00

    输出#2

    4
  • 输入#3

    73

    输出#3

    15

说明/提示

In the first sample the counter may be supposed to show 88 or 89.

In the second sample the good integers are 00, 08, 80 and 88.

In the third sample the good integers are 03, 08, 09, 33, 38, 39, 73, 78, 79, 83, 88, 89, 93, 98, 99.

在第一个样例中,计数器可能显示为 88 或 89。

在第二个样例中,合法的整数为 00、08、80 和 88。

在第三个样例中,合法的整数为 03、08、09、33、38、39、73、78、79、83、88、89、93、98、99。

输入解题思路,AI测评打分。不知道怎么写?

首页