Codeforces Round #282 (Div. 2) A
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 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.
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.
#include<stdio.h>
int main()
{
int n,a[10]={2,7,2,3,3,4,2,5,1,2};
while(scanf("%d",&n)!=EOF)
{
printf("%d\n",a[n/10]*a[n%10]);
}
}
Codeforces Round #282 (Div. 2) A的更多相关文章
- Codeforces Round #282 (Div. 1) A. Treasure 水题
A. Treasure Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/494/problem/A ...
- Codeforces Round #282 Div.1 B Obsessive String --DP
题意: 给两个串S,T,问能找出多少的S的(a1,b1)(a2,b2)..(ak,bk),使Sa1---Sb1,...Sak---Sbk都包含子串T,其中k>=1,且(a1,b1)...(ak, ...
- codeforces 494a//Treasure// Codeforces Round #282(Div. 1)
题意:一个'(' , ')' , '#'组成的串,可将'#'换成至少一个')'.问一个换法能使串匹配. 至少换成一个,那么就先都换成一个,记结果为str.最后一个')'的后面没有未匹配的'(' ...
- 数学 Codeforces Round #282 (Div. 2) B. Modular Equations
题目传送门 题意:a % x == b,求符合条件的x有几个 数学:等式转换为:a == nx + b,那么设k = nx = a - b,易得k的约数(>b)的都符合条件,比如a=25 b=1 ...
- Codeforces Round #282 (Div. 1)B. Obsessive String KMP+DP
B. Obsessive String Hamed has recently found a string t and suddenly became quite fond of it. He s ...
- Codeforces Round #366 (Div. 2) ABC
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate ...
- Codeforces Round #354 (Div. 2) ABCD
Codeforces Round #354 (Div. 2) Problems # Name A Nicholas and Permutation standard input/out ...
- Codeforces Round #368 (Div. 2)
直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输 ...
- cf之路,1,Codeforces Round #345 (Div. 2)
cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅..... ...
随机推荐
- 【CF666E】Forensic Examination - 广义后缀自动机+线段树合并
广义SAM专题的最后一题了……呼 题意: 给出一个长度为$n$的串$S$和$m$个串$T_{1\cdots m}$,给出$q$个询问$l,r,pl,pr$,询问$S[pl\cdots pr]$在$T_ ...
- ssh远程连接和linux基本操作
客户端工具:Xshell,SecureCRT 启动网卡(eth0): ifup eth0 查看IP地址: ifconfig [root@oldboy~] : [登入名 @ 主机名 文件或者 ...
- MNIST机器学习数据集
介绍 在学习机器学习的时候,首当其冲的就是准备一份通用的数据集,方便与其他的算法进行比较.在这里,我写了一个用于加载MNIST数据集的方法,并将其进行封装,主要用于将MNIST数据集转换成numpy. ...
- JavaScript中的XMLDOM对象
测试: demo.xml中的内容: js文件内容: window.onload=function(){ //var v=returnXMLDOM(); //v.loadXML('<root> ...
- The Basics of Numpy
在python语言中,Tensorflow中的tensor返回的是numpy ndarray对象. Numpy的主要对象是齐次多维数组,即一个元素表(通常是数字),所有的元素具有相同类型,可以通过有序 ...
- UVA11752 The Super Powers
/* UVA11752 The Super Powers https://vjudge.net/contest/153365#problem/Y 数论 注意a^n=b要用除法求,并且求得的n比实际大1 ...
- 操作服务器及MySQL数据库可以使其远程链接
转自原文操作服务器及MySQL数据库可以使其远程链接 一般情况分三个地方准备,MySQL数据库,防火墙,还有你的服务器主机的准备 操作系统为centos6.5.其他系统大致差不多. 1:在服务器中安装 ...
- stylesheet_link_tag,javascript_include_tag无效?
stylesheet_link_tag,javascript_include_tag无效? http://stackoverflow.com/questions/28241981/rails-4-ex ...
- [Web Worker] Introduce to Web Worker
What is web worker for? OK, read it docs to get full details idea. Or just a quick intro to web work ...
- Gzip压缩优化网站
网站常使用GZIP压缩算法对网页内容进行压缩,然后传给浏览器,以减小数据传输量,提高响应速度.浏览器接收到GZIP压缩数据后会自动解压并正确显示.GZIP加速常用于解决网速慢的瓶颈. 压缩Filter ...