495A - Digital Counter
1 second
256 megabytes
standard input
standard output
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 of88.
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.
The only line of input contains exactly two digits representing number n (0 ≤ n ≤ 99).
Note that n may have a leading zero.
In the only line of the output print the number of good integers.
89
2
00
4
73
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.
d=[2, 7, 2, 3, 3, 4, 2, 5, 1, 2]
a= gets.to_i
puts d[a/10]*d[a%10]
495A - Digital Counter的更多相关文章
- codeforces 495A. Digital Counter 解题报告
题目链接:http://codeforces.com/problemset/problem/495/A 这个题目意思好绕好绕~~好绕~~~~~,昨天早上做得 virtual 看不懂,晚上继续看还是,差 ...
- RFID 读写器 Reader Writer Cloner
RFID读写器的工作原理 RFID的数据采集以读写器为主导,RFID读写器是一种通过无线通信,实现对标签识别和内存数据的读出和写入操作的装置. 读写器又称为阅读器或读头(Reader).查询器(Int ...
- RFID Reader 线路图收集
This 125 kHz RFID reader http://www.serasidis.gr/circuits/RFID_reader/125kHz_RFID_reader.htm http:// ...
- Codeforces Round #282 (Div. 2) A
解题思路:用数组将每一个显示数字可能表示的数字种数存储起来即可 反思:第一次做的时候没有做出来是因为题意理解错误,第二次WA是因为情况没有考虑完全,1对应有7个数字,5对应有4个数字 A. ...
- Digital Current-Mode Control Challenges Analog Counterparts
http://electronicdesign.com/digital-ics/digital-current-mode-control-challenges-analog-counterparts ...
- Application binary interface and method of interfacing binary application program to digital computer
An application binary interface includes linkage structures for interfacing a binary application pro ...
- Cracking Digital VLSI Verification Interview 第二章
Computer Architecture 对Cracking Digital VLSI Verification Interview:Interview Success这本书的汉化,最新更新请关注微 ...
- UNITY自带的PACKAGE的UTILITY 里面有一个自带的FPS COUNTER
UNITY自带的PACKAGE的UTILITY 里面有一个自带的FPS COUNTER 可用,但是脚本是保密的?
- [LeetCode] Design Hit Counter 设计点击计数器
Design a hit counter which counts the number of hits received in the past 5 minutes. Each function a ...
随机推荐
- 利用HTML5新特性改变浏览器地址后不刷新页面
原文:http://www.cnblogs.com/xuchengzone/archive/2013/04/18/html5-history-pushstate.html 作为一个程序员,上Git ...
- HTML5 设备上的API
一.Vibration API ,接受两种类型参数 vibrate (unsigned long time) 当参数是unsigned long的时候 此时参数表示震动时间. NotSuppor ...
- 第一章 Linux系统介绍与环境搭建准备
1.操作系统: Operating System,简称OS,它是应用程序运行以及用户操作必备的基础环境支撑,是计算机系统的核心. 操作系统就是处于用户与计算机系统硬件之间用于传递信息的系统程序软件. ...
- [转载] Thrift-server与spring集成
转载自http://shift-alt-ctrl.iteye.com/blog/1990026 Thrift服务server端,其实就是一个ServerSocket线程 + 处理器,当Thrift-c ...
- fragmentTabHost 使用示例
目前我们看微信的底部,有四个导航栏,那我们应该来怎么实现类似的导航栏呢? 在 android 4.0 的时候,推出了一个新的工具,fragmentTabHost . fragmentTabHost ...
- 使用JavaScript生成二维码教程-附qrcodejs中文文档
使用javascript生成二维码 依赖jquery 需要使用到的库 https://github.com/davidshimjs/qrcodejs DIV <div id="qrco ...
- 来手撸一个小小小小小"3D引擎"
开始的唠叨 说是3D引擎确实有点过于博眼球了,其实就是实现了一个透视投影,当然也不是那么简单的. 此篇文章是纯粹给小白看的 高手请勿喷 .也称之为小向带你图形学入门基础 . 哇哈哈哈哈 一说到做一个3 ...
- 实战Excel Add-in的三种玩法
作者:陈希章 发表于 2017年11月26日 前言 这个系列文章应该有一阵子没有更新了,原因是一如既往的多,但是根本所在是我对于某些章节其实还没有完全想好怎么写,尤其是对于Office Add-in这 ...
- async await Task
一.使用Task 引用命名空间 using System.Threading.Tasks; 1.工厂方式 Task.Factory.StartNew(() => {Console.WriteLi ...
- JavaScript DOM 编程艺术(1)---> JavaScript语法
一. JavaScript语法目录 语法 操作 条件语句 循环语句 函数 对象 二. 具体内容 2.1 语法 javaScript代码要通过HTML/XHTML文档才能执行.可以有两种方式完成这一 ...