시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 35 11 9 34.615%

문제

전자 장비에서 숫자를 보여주기 위해 가장 많이 사용하는 장치는 7세그먼트이다. 7세그먼트느 7개의 세그먼트로 숫자를 나타낸다. 가로 세그먼트가 3개, 세로 세그먼트가 4개가 있고, 각 세그먼트느 불이 켜져있을 수도 있고, 꺼져있을 수도 있으며, 독립적으로 동작한다. 아래 그림은 0부터 9까지 숫자를 7세그먼트로 나타낸 것이다.

동시에 숫자 여러 개를 보여주려면, 7세그먼트를 여러 개 놓으면 된다. 예를 들어, 시계는 7세그먼트 4개를 이용해서 시 (00~23)와 분 (00~59)를 보여준다.

현수는 지나가다가 고장난 알람 시계를 하나 주었다. 알람 시계는 올바른 시간을 항상 보여주지 않는데, 현수는 7세그먼트의 전산이 망가진 것이 원인이라 생각한다.

알람 시계의 7세그먼트의 고장난 세그먼트는 항상 불이 켜지지 않는다. 나머지 세그먼트는 정상적으로 동작한다. 시계를 구성하는 세그먼트 28개는 완전히 고장났거나(절대 불이 켜지지 않거나), 완벽하게 동작한다(불이 정상적으로 켜지고 꺼진다).

현수는 지금이 시간이 궁금하다. 하지만, 가지고 있는 시계는 지나가다 주운 시계밖에 없다. 현수는 시계를 쳐다보면서, 1분마다 표시되는 시간을 종이에 적어놓았다. (고장난 시계이기 때문에, 시간이 몇 분 동안 바뀌지 않을 수 있다)

현수가 종이에 적어놓은 시간이 주어졌을 때, 처음 시간을 종이에 적었을 때의 시간을 구하는 프로그램을 작성하시오. 모든 세그먼트는 고장났거나 (불이 절대 켜지지 않는다) 완벽하게 동작한다 (불이 켜져야 하는 시간에는 켜지고, 꺼져야 하는 시간에는 꺼진다)

정답이 여러 가지가 나올 수 있다. 이 경우에는 가능한 정답을 모두 구한다.

입력

입력은 여러 개의 테스트 케이스로 이루어져 있다.

각 테스트 케이스의 첫째 줄에는 시계를 관찰한 시간 N이 주어진다. (1 ≤ N ≤ 50) 다음에는 N개의 시간이 주어진다. 시간의 시와 분은 두 자리 숫자이며, ':'로 구분되어져 있다. 시간은 관찰한 순서대로 주어진다.

7세그먼트가 표시하는 시간이 0-9 숫자로 나타낼 수 없는 경우가 발생할 수도 있다. 하지만, 알 수 없는 이유에 의해서 이런 현상은 현수가 시계를 관찰하는 동안 발생하지 않는다.

출력

각 테스트 케이스에 마다, 가능한 시간을 오름차순으로 모두 출력한다. 시간은 항상 올바른 시간이어야 한다. 가능한 시간이 없는 경우에는 none을 출력한다.

예제 입력 1

1 88:88
2 23:25 23:26
3 71:57 71:57 71:07

예제 출력 1

none
23:25
00:58 03:58 07:58 08:58

힌트

W3sicHJvYmxlbV9pZCI6IjM2NDMiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWI1MTRcdWM5YzBcdWQxMzggXHVjMmRjXHVhY2M0IiwiZGVzY3JpcHRpb24iOiI8cD5cdWM4MDRcdWM3OTAgXHVjN2E1XHViZTQ0XHVjNWQwXHVjMTFjIFx1YzIyYlx1Yzc5MFx1Yjk3YyBcdWJjZjRcdWM1ZWNcdWM4ZmNcdWFlMzAgXHVjNzA0XHVkNTc0IFx1YWMwMFx1YzdhNSBcdWI5Y2VcdWM3NzQgXHVjMGFjXHVjNmE5XHVkNTU4XHViMjk0IFx1YzdhNVx1Y2U1OFx1YjI5NCA3XHVjMTM4XHVhZGY4XHViYTNjXHVkMmI4XHVjNzc0XHViMmU0LiA3XHVjMTM4XHVhZGY4XHViYTNjXHVkMmI4XHViMjkwIDdcdWFjMWNcdWM3NTggXHVjMTM4XHVhZGY4XHViYTNjXHVkMmI4XHViODVjIFx1YzIyYlx1Yzc5MFx1Yjk3YyBcdWIwOThcdWQwYzBcdWIwYjhcdWIyZTQuIFx1YWMwMFx1Yjg1YyBcdWMxMzhcdWFkZjhcdWJhM2NcdWQyYjhcdWFjMDAgM1x1YWMxYywgXHVjMTM4XHViODVjIFx1YzEzOFx1YWRmOFx1YmEzY1x1ZDJiOFx1YWMwMCA0XHVhYzFjXHVhYz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GluZSBvZiBvdXRwdXQuPFwvcD5cclxuXHJcbjxwPklmIHRoZXJlIGlzIGF0IGxlYXN0IG9uZSBwb3NzaWJsZSBhbnN3ZXIsIHByaW50IGEgbGlzdCBvZiBhbGwgcG9zc2libGUgYW5zd2VycyBzZXBhcmF0ZWQgYnkgc3BhY2VzLiBFYWNoIHBvc3NpYmxlIGFuc3dlciBtdXN0IGJlIGEgdmFsaWQgMjQtaG91ciBjbG9jayB0aW1lLCBmb3JtYXR0ZWQgYXMgdHdvIGRpZ2l0cyAoMDAgdG8gMjMpLCBmb2xsb3dlZCBieSBhICZsc3F1bzs6JnJzcXVvOyBjaGFyYWN0ZXIsIGZvbGxvd2VkIGJ5IHR3byBkaWdpdHMgKDAwIHRvIDU5KS4gVGhlIGxpc3Qgb2YgcG9zc2libGUgYW5zd2VycyBtdXN0IGJlIHByaW50ZWQgaW4gb3JkZXIgb2YgaW5jcmVhc2luZyB0aW1lIG9mIGRheS48XC9wPlxyXG5cclxuPHA+SWYgdGhlcmUgaXMgbm8gcG9zc2libGUgYW5zd2VyLCBwcmludCB0aGUgd29yZCAmbHNxdW87bm9uZSZyc3F1bzsuPFwvcD5cclxuIiwiaGludCI6IiIsIm9yaWdpbmFsIjoiMSIsInByb2JsZW1fbGFuZ19jb2RlIjoiXHVjNjAxXHVjNWI0In1d

출처

ACM-ICPC > Regionals > Europe > Northwestern European Regional Contest > NWERC 2012 D번

  • 문제를 번역한 사람: baekjoon
  • 잘못된 번역을 찾은 사람: cokcjswo