解题思路:用数组将每一个显示数字可能表示的数字种数存储起来即可
反思:第一次做的时候没有做出来是因为题意理解错误,第二次WA是因为情况没有考虑完全,1对应有7个数字,5对应有4个数字
 
 
 
A. Digital Counter
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

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.

Input

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

Output

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

Sample test(s)
input
  1. 89
output
  1. 2
input
  1. 00
output
  1. 4
input
  1. 73
output
  1. 15
Note

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.

  1. #include<stdio.h>
  2. int main()
  3. {
  4. int n,a[10]={2,7,2,3,3,4,2,5,1,2};
  5. while(scanf("%d",&n)!=EOF)
  6. {
  7. printf("%d\n",a[n/10]*a[n%10]);
  8. }
  9. }

  

Codeforces Round #282 (Div. 2) A的更多相关文章

  1. Codeforces Round #282 (Div. 1) A. Treasure 水题

    A. Treasure Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/494/problem/A ...

  2. 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, ...

  3. codeforces 494a//Treasure// Codeforces Round #282(Div. 1)

    题意:一个'('  ,  ')'  ,  '#'组成的串,可将'#'换成至少一个')'.问一个换法能使串匹配. 至少换成一个,那么就先都换成一个,记结果为str.最后一个')'的后面没有未匹配的'(' ...

  4. 数学 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 ...

  5. 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 ...

  6. 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 ...

  7. Codeforces Round #354 (Div. 2) ABCD

    Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/out ...

  8. Codeforces Round #368 (Div. 2)

    直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输 ...

  9. cf之路,1,Codeforces Round #345 (Div. 2)

     cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅.....   ...

随机推荐

  1. (转) shiro权限框架详解04-shiro认证

    http://blog.csdn.net/facekbook/article/details/54906635 shiro认证 本文介绍shiro的认证功能 认证流程 入门程序(用户登录和退出) 自定 ...

  2. JS 垃圾回收机制

    [转自]:https://segmentfault.com/a/1190000018605776 垃圾回收 JavaScript 中的内存管理是自动执行的,而且是不可见的.我们创建基本类型.对象.函数 ...

  3. codeforces 789 B. Masha and geometric

    链接 B. Masha and geometric depression 题意 给你一个等比数列的首项和公比q,然后给出一个上限l,m个数字,在这个等比数列里,小于l且没有在m个数字里面出现过的可以写 ...

  4. JS 20180416作业

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  5. JS 作业

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  6. 什么是JSON ?

    JSON 实例 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <t ...

  7. POJ 3281 Dining[网络流]

    Cows are such finicky eaters. Each cow has a preference for certain foods and drinks, and she will c ...

  8. 代码检查工具sonarqube介绍及使用

    亲测有效 环境:springboot+gradle+jdk1.8+sonarqube7.4 一.说明: SonarQube为静态代码检查工具,采用B/S架构,帮助检查代码缺陷,改善代码质量,提高开发速 ...

  9. nmcli 静态方式添加IP地址

    [root@ansible02:/root] > ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state U ...

  10. VS2015 C#取消最大化按钮,设置鼠标不可调整窗体大小

    取消最大化按钮设置  设置窗体不可被鼠标调整大小