收藏 分销(赏)

LEDDisplay.doc

上传人:pc****0 文档编号:7782529 上传时间:2025-01-16 格式:DOC 页数:2 大小:33KB 下载积分:10 金币
下载 相关 举报
LEDDisplay.doc_第1页
第1页 / 共2页
LEDDisplay.doc_第2页
第2页 / 共2页
本文档共2页,全文阅读请下载到手机保存,查看更方便
资源描述
LED Display Time Limit:1 Second Memory Limit:32768 KB One day in the laboratory, Fred found some LED displays. This seven-segment LED can display digit 0 to 9 properly. But Fred soon find the LED have a serious problem, at the beginning, the seven bars were all on. But when one bar once was trun off, it can't be turn on again! So ecah LED only can display digit in certain oder. For example, one LED can display 9,3,7 successively, but can't display 2,4. Now, Fred have a task to display a sequence of digit that is between 0 to 9. Because of the shortcoming of these LEDs, he need a number of them. But he also want to minimize the number, can you help him? NOTE:If two digits in a sequece are the same,Fred want for the clearness, so he thought the latter digit can't be displayed on the same LED. Input: The input consists of several test cases. The first line of each test case contains a positive integer N (<=1000), then followed by a list of N digits. Each digit follows with a blank space. Output: For each test case, you must print a minimum number of LED that Fred need in one line. Sample Input: 1 8 4 9 0 7 3 8 8 8 8 9 6 5 4 1 Sample Output: 1 2 (Hint:one mothod is display {9,3} on the first LED; {0,7} on the second) 3 (Hint:one possible solution is {8},{8,9,4,1},{8,6,5}) Author:JIANG, Dongming 大概意思:7个LED为一组表示一个数字(如图),每个LED打开关闭一次就不能再打开了。现在要用最少的LED表示一串数字,比如: 用6个LED可以表示“9”,然后关掉一个LED,可以表示“3”。但是这时不能用这一组LED表示“8”,因为有一个LED被关掉过不能再打开了,要想表示“8”就必须另用一组LED。 现在要表示“9073”这组数字,在第一个LED表示“9”和“3”,在第二个LED表示“0”和“7”。 题目要求就是任意给一组数字,要求程序能判断最少需要多少组LED。语言任意,运行时间少于1秒,内存少于32768 KB
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 百科休闲 > 其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服