Logo
(追記) (追記ここまで)

3283번 - BARCODE 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB108352738.571%

문제

To speed a work of cashiers, each product is marked with a series of black and white vertical bars called bar code. It can be transformed to a sequence of zeroes and ones with an optical reader. That sequence represents a code of a product.

Bar code consists of black and white vertical bars, which can be thin or thick. White and black bars alternate, i.e. no two adjacent bars are of the same color. Thin bar represent 0 and thick bar represent 1, regardless of its color. Thus a bar code represents a sequence of binary digits.

Each bar in a bar code on a product appears as five ‘squares’ high column (see the picture below). Width of a thin bar is one and of a thick bar are two ‘squares’. For example, bar code depicted below represents the sequence 010001.

Bar code reader used in this problem fell on a floor and since then was unable to properly recognize a color of some ‘squares’ of a bar code.

Write a program that will from a given scanning of a bar code with our faulty reader determine which sequence of binary digits it represents if it is possible.

입력

The first line of input file contains an integer N, 1 ≤ N ≤ 100, representing total width of scanned bar code.

Each of next five lines contains N characters, each of which can be ‘X’, ‘.’ (dot) or ‘?’ (question mark), where X represents successfully recognized black ‘square’, a dot represents successfully recognized white ‘square’ and question mark means that our reader didn’t determine the colour of the ‘square’.

출력

The first and only line of output file should contain a sequence of binary digits represented with bar code given in input file if it can be determined. If a sequence cannot be determined, word ‘UNDETERMINABLE’ should be written to the first line instead.

제한

예제 입력 1

4
.X??
.??.
??.?
?X.?
.X?.

예제 출력 1

001

예제 입력 2

8
?.?X?X??
??.X??..
????????
?.???X..
?..X?X??

예제 출력 2

010001

예제 입력 3

9
XX.?X..?X
?X.?X?.?X
XX.?X..??
X?.?X..?X
XX.?X?.?X

예제 출력 3

UNDETERMINABLE

힌트

출처

Olympiad > Croatian Highschool Competitions in Informatics > 2001 > National Competition #1 - Juniors 2번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /