当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2020:MisLED

题目描述
Rocky rolled over in his bed and looked at his LED alarm clock. He saw what was displayed and went back to sleep. Later, he woke up again and once again glanced at the alarm clock. Although he did not know if all the LED segments were working, he was able to determine with certainty the time. Could you?

Rocky's LED clock uses four 7-segment displays to show the time.

Each 7-segment display has seven bars on it, and displays different numbers by turning on different bars:
 _       _  _       _   _   _   _   _

| | | _| _| |_| |_ |_ | |_| |_|
|_| | |_ _| | _| |_| | |_| _|

Using a bit to represent each segment, we can describe a display with seven bits. For example, if the segments are numbered as such:

Then the display:
|_

|

can be represented with bits:
0000111

And the numbers therefore could be represented by:
NumberBit 1Bit 2Bit 3Bit 4Bit 5Bit 6Bit 7
01111110
10110000
21101101
31111001
40110011
51011011
61011111
71110000
81111111
91111011

If a segment on the display is "burnt out", however, it will not display even though it should. For example, if the number three were to be displayed, but the segment corresponding with bit 7 were burnt out, the display would instead be:
 _ 

|
_|
输入解释
The first line contains a single integer n indicating the number of data sets.

Each data set is a single line containing eight 7-bit strings representing the LED displays observed. The first four strings will represent the first time displayed and the next four strings will represent the second time displayed. All of the strings will be separated by a single space. Note: It is not given in the input which segments are burnt out.
输出解释
For each data set, there will be exactly one line of output. This line will simply be the second time observed in the LED display, in the format HH:MM. The segments that are burnt out will be consistent between the first and second time displayed. There will only be one possible solution for each data set.

All times (for input and output) will be represented in standard (non-military) format, with no leading zeros (nine o'clock is 9:00, not 09:00).
输入样例
2
0110000 1101101 1111110 1111111 0000000 1111011 1111110 1111111
0000000 0000000 1000001 1111111 0100000 0000001 0000000 0110000
输出样例
9:08
12:11

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 South Central USA 2004

源链接: POJ-2020

最后修改于 2020-10-29T06:20:45+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 30000