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连试试水的深浅..... ...
随机推荐
- Fear No More歌词
"Fear No More" Every anxious thought that steals my breath It's a heavy weight upon my ...
- jQuery 插入元素
在被选元素的内部 prepend() 方法在被选元素的开头(仍位于内部)插入指定内容. append() 方法在被选元素的结尾(仍然在内部)插入指定内容.
- 机器学习PAI快速入门
什么是机器学习? 机器学习(Machine Learning, ML)是一门多领域交叉学科,涉及概率论.统计学.逼近论.凸分析.算法复杂度理论等多门学科.专门研究计算机怎样模拟或实现人类的学习行为,以 ...
- 复习MySQL①创建数据库及数据表
• 创建数据库:create database 数据库名称; – 例:创建名为test的测试数据库 create database test; • 查看创建好的数据库:show create data ...
- MySQL笔记4------面试问题
1.链接1:https://blog.csdn.net/derrantcm/article/details/51533885. 链接2:https://blog.csdn.net/derrantcm/ ...
- [长期更新]模板&算法学习情况
这里仅作为自我检查用,模板代码请移步其他博文 标+的表示已学完,标?的表示需要进一步学习,标-的表示有计划但未开始学习,标*的表示暂时没有计划学习 数学 ?BSGS +FFT&NTT ?Luc ...
- 终极对决!Dubbo 和 Spring Cloud 微服务架构到底孰优孰劣
标签: 微服务dubbospring架构 前言 微服务架构是互联网很热门的话题,是互联网技术发展的必然结果.它提倡将单一应用程序划分成一组小的服务,服务之间互相协调.互相配合,为用户提供最终价值.虽然 ...
- Spring中的容器
1.Spring容器 Spring容器最基本的接口就是BeanFactory, 负责配置,创建和管理bean.我们通常不直接使用BeanFactory接口,而是使用其子接口ApplicationCon ...
- Zepto.js实现fadeIn,fadeOut功能
Zepto是一个轻量级的针对现代高级浏览器的JavaScript库, 它与jquery有着类似的api. 如果你会用jquery,那么你也会用zepto. Zepto的设计目的是提供 jQuery 的 ...
- 【codeforces 807D】Dynamic Problem Scoring
[题目链接]:http://codeforces.com/contest/807/problem/D [题意] 给出n个人的比赛信息; 5道题 每道题,或是没被解决->用-1表示; 或者给出解题 ...