시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 302 68 46 26.744%

문제

Brainfuck은 Urban Müller가 1993년에 만든 프로그래밍 언어이다. 그의 목적은 역사상 가장 작은 튜링 완전 언어(Turing -complete language)의 컴파일러를 만드는 것이었다.위키백과에는 다음과 같은 설명이 적혀져 있다. (designed to challenge and amuse programmers, and was not made to be suitable for practical use)

이 언어는 0으로 초기화 된 크기가 32768바이트인 바이트 배열, 배열의 맨 첫 바이트를 가리키는 포인터를 가지고 있다.

다음과 같이 7가지 명령어를 가지고 있으며, 각 명령어는 문자 1글자이다. (원래 8가지 명령어를 가지고 있지만, 문제를 위해 하나를 지웠다)

  • >: 포인터를 증가시킨다. 만약, 포인터 값이 32767이면 0이된다.
  • <: 포인터를 감소시킨다. 만약, 포인터 값이 0이면 32767이 된다.
  • +: 포인터가 가리키는 값을 증가시킨다. 255를 증가시키면 0이 된다.
  • -: 포인터가 가리키는 값을 감소시킨다. 0을 감소시키면 255가 된다.
  • .: 포인터가 가리키는 값을 ASCII문자로 출력한다.
  • [: 포인터가 가리키는 값이 0이면, 짝이 되는 뒤쪽의 ]로 이동한다.
  • ]: 포인터가 가리키는 값이 0이 아니면, 짝이되는 앞쪽의 [로 이동한다.

Brainfuck 프로그램이 주어졌을 때, 이 프로그램의 출력을 출력하는 프로그램을 작성하시오.

입력

첫째 줄에 프로그램의 개수 T(1<=T<=100)가 주어진다. 각 프로그램은 한줄 또는 그 이상으로 구성되어 있으며, end만 적혀있는 줄로 끝난다. 프로그램에 올바르지 않은 문자 (<>+-.[])가 있다면, 이는 무시하고 넘어가야 한다. %는 주석을 의미하며, %가 나온 뒤에 나오는 해당 줄의 문자는 모두 무시한다. 프로그램의 최대 명령어 개수는 128000이다.

출력

각 프로그램의 결과를 다음과 같이 출력한다. 첫째 줄에 PROGRAM #n을 출력한다. n은 프로그램 번호이다. (첫 번째 프로그램부터 차례대로 1이고, 1 <= n <= N이다). 둘째 줄에는 프로그램의 결과를 출력한다. 만약 [나 ]가 짝이 맞지 않을 대는 COMPILE ERROR를 출력하면 된다. 출력에서 여러 줄을 출력할 수도 있다.

예제 입력 1

3
++++++++[>+++++++++ % hello-world.
<-]>.<+++++[>++++++<-]>-.+++++++..
+++.<++++++++[>>++++<<-]>>.<<++++[>
------<-]>.<++++[>++++++<-]>.+++.
------.--------.>+.
end
+++[>+++++++[.
end
%% Print alphabet, A-Z.
+ + + + + +++++++++++++++++++++>
++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++
+< [ >.+<- ]
end

예제 출력 1

PROGRAM #1:
Hello World!
PROGRAM #2:
COMPILE ERROR
PROGRAM #3:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
W3sicHJvYmxlbV9pZCI6IjI3MzMiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJCcmFpbmYqY2siLCJkZXNjcmlwdGlvbiI6IjxwPkJyYWluZnVja1x1Yzc0MCBVcmJhbiBNJnV1bWw7bGxlclx1YWMwMCAxOTkzXHViMTQ0XHVjNWQwIFx1YjljY1x1YjRlMCBcdWQ1MDRcdWI4NWNcdWFkZjhcdWI3OThcdWJjMGQgXHVjNWI4XHVjNWI0XHVjNzc0XHViMmU0LiBcdWFkZjhcdWM3NTggXHViYWE5XHVjODAxXHVjNzQwIFx1YzVlZFx1YzBhY1x1YzBjMSBcdWFjMDBcdWM3YTUgXHVjNzkxXHVjNzQwIFx1ZDI5Y1x1YjljMSBcdWM2NDRcdWM4MDQgXHVjNWI4XHVjNWI0KFR1cmluZyAtY29tcGxldGUgbGFuZ3VhZ2UpXHVjNzU4IFx1Y2VmNFx1ZDMwY1x1Yzc3Y1x1YjdlY1x1Yjk3YyBcdWI5Y2NcdWI0ZGNcdWIyOTQgXHVhYzgzXHVjNzc0XHVjNWM4XHViMmU0LjxhIGhyZWY9XCJodHRwczpcL1wvZW4ud2lraXBlZGlhLm9yZ1wvd2lraVwvQnJhaW5mdWNrXCI+XHVjNzA0XHVkMGE0XHViYz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JlIGlzIGFuIHVubWF0Y2hlZCBbIG9yIF0gaW4gdGhlIGJyYWluZipjayBwcm9ncmFtLiBJZiB5b3VyIHByb2dyYW0gZW5jb3VudGVycyBzdWNoIGFuIGVycm9yLCBpdCBzaG91bGQgc2ltcGx5IHByaW50IENPTVBJTEUgRVJST1IgaW5zdGVhZCBvZiBleGVjdXRpbmcgdGhlIHByb2dyYW0uIEFsbCBicmFpbmYqY2sgcHJvZ3JhbXMgd2lsbCB1c2Ugbm8gbW9yZSB0aGFuIHRoZSBzcGVjaWZpZWQgMzI3NjggYnl0ZXMgb2YgbWVtb3J5LiZuYnNwOzxcL3A+XHJcbiIsImhpbnQiOiIiLCJvcmlnaW5hbCI6IjEiLCJwcm9ibGVtX2xhbmdfY29kZSI6Ilx1YzYwMVx1YzViNCJ9XQ==

출처

ACM-ICPC > Regionals > North America > Greater New York Region > 2005 Greater New York Programming Contest E번