시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 128 MB84000.000%

문제

다음과 같은 가상의 프로그래밍 언어 L이 있다.

  1. L 프로그램의 각 줄은 순서대로 1부터 N(1 ≤ N ≤ 100,000)의 번호가 붙어 있다.
  2. 각 줄에는 정확히 한 개의 명령어만 들어간다.
  3. 프로그램은 첫 번째 줄부터 수행된다.
  4. 가능한 명령은 ifgo, jump, pass, loop, die의 다섯 가지만 있다.
  5. 각 줄을 수행할 때마다 그 줄의 번호가 출력된다. 그 명령이 입력을 받는 명령일 경우에도 줄 번호가 먼저 출력된다.
  6. ifgo 명령은 다른 명령의 줄 번호를 의미하는 한 개의 인자를 갖는다. 이 명령을 수행하면 한 비트의 입력을 받는다. 만약 입력이 1이면 명령에 지시된 줄 번호로 이동한다. 만약 입력이 0이면 다음 줄로 이동한다.
  7. jump 명령은 다른 명령의 줄 번호를 의미하는 한 개의 인자를 갖는다. 이 명령을 수행하면 명령에 지시된 줄 번호로 이동한다.
  8. pass 명령은 인자가 없는 명령이다. 이 명령을 수행하면 아무 것도 하지 않고, 줄 번호만 출력한 다음에 다음 줄로 이동한다.
  9. die 명령은 인자가 없는 명령이다. 이 명령을 수행하면 줄 번호를 출력한 다음에 프로그램이 끝난다. 이 명령은 반복문 안에서는 사용되지 않는다.
  10. loop 명령은 반복문을 수행할 때 사용되는데, 두 개의 인자 l, c를 갖는다. l은 반복문이 시작되는 줄 번호이고, c는 반복 회수이다. l은 항상 loop 명령이 있는 줄 번호보다 작은 값을 갖는다. 이 명령을 수행하면 l번째 줄부터 loop 명령이 있는 줄까지를 c-1번 수행한다. 반복문이 끝난 다음에는 그 다음 줄로 이동한다.
  11. ifgo, jump 명령은 그 명령이 있는 반복문의 범위에서만 이동할 수 있다. 즉, 두 명령이 반복문 안에 있는 경우, 그 반복문의 범위 밖으로 이동할 수 없다. 또한, 반복문 안에 두 명령어가 있고, 그 다음 줄에 또다른 반복문이 있는 경우, 안쪽 반복문 안으로 이동할 수는 없다. 예를 들면 다음과 같은 경우는 잘못된 프로그램이다.
  12. 반복문 안에 반복문이 들어갈 경우, 안쪽 반복문이 바깥쪽 반복문에 완전히 포함되어야 한다. 즉, 안쪽 반복문의 시작 줄 번호가 바깥쪽 반복문의 시작 줄 번호보다 커야 한다(같은 경우도 안 됨). 그 외의 형태로 두 반복문이 겹치는 경우는 없다.
  13. 프로그램의 제일 마지막 줄이 수행되었을 때, 그 명령이 die가 아닌 경우 프로그램은 첫 번째 줄부터 다시 수행된다.
  14. 프로그램을 알아보기 쉽게 하기 위해 각 줄에 스페이스나 탭이 여러 개 들어갈 수도 있다.
  15. 각 줄의 최대 길이는 스페이스나 탭을 포함하여 80자를 넘지 않는다.

L로 짠 프로그램이 주어졌을 때, 그 프로그램이 최대 몇 번이나 줄 번호를 출력하는지 계산하는 프로그램을 작성하시오. Ifgo 명령의 경우, 입력값에 따라서 출력 회수가 변할 수 있는데, 출력 회수가 최대가 되는 입력이 주어진다고 가정한다.

입력

첫째 줄에 N이 주어진다. 다음 N개의 줄에 L 프로그램이 첫째 줄부터 차례대로 주어진다.

출력

첫째 줄에 최대 출력 회수를 출력한다. 답은 항상 1,000,000,000이하이며, 이를 넘어가는 경우는 무한 번 수행되는 경우로 infinity를 출력하도록 한다.

예제 입력 1

8
	pass
		ifgo 4
		jump 5
		ifgo 3
	loop 2 2
	pass
loop 1 2
die

예제 출력 1

23

예제 입력 2

3
ifgo 2
loop 1 3
die

예제 출력 2

7

예제 입력 3

4
ifgo 2
ifgo 3
pass
die

예제 출력 3

4
W3sicHJvYmxlbV9pZCI6IjIxMTkiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWQ1MDRcdWI4NWNcdWFkZjhcdWI3OThcdWJjMGQgXHVjNWI4XHVjNWI0IEwiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YjJlNFx1Yzc0Y1x1YWNmYyBcdWFjMTlcdWM3NDAgXHVhYzAwXHVjMGMxXHVjNzU4IFx1ZDUwNFx1Yjg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aW5zIHNldmVyYWwgcHJvZ3JhbXMsIHNlcGFyYXRlZCB3aXRoIGFuIGVtcHR5IGxpbmUuIEVhY2ggb2YgdGhlbSBpcyBhIGNvcnJlY3QgVG9tYXRvIHByb2dyYW0uJm5ic3A7PFwvcD5cclxuIiwib3V0cHV0IjoiPHA+Rm9yIGVhY2ggZ2l2ZW4gcHJvZ3JhbSB5b3VyIHNvbHV0aW9uIGhhcyB0byBwcmludCBvbiBhIHNlcGFyYXRlIGxpbmUgdGhlIG1heGltYWwgbGVuZ3RoIG9mIHRoZSBvdXRwdXQgc2VxdWVuY2UgdGhlIHByb2dyYW0gY291bGQgZ2VuZXJhdGUuIFByaW50IGluZmluaXR5IGlmIHRoZXJlIGlzIG5vIG1heGltYWwgbGVuZ3RoIGZvciB0aGUgb3V0cHV0IHNlcXVlbmNlLiBXaGVuIGZpbml0ZSwgdGhlIG1heGltYWwgbGVuZ3RoIHdpbGwgbm90IGV4Y2VlZCAxMDxzdXA+OTxcL3N1cD4uPFwvcD5cclxuIiwiaGludCI6IiIsIm9yaWdpbmFsIjoiMSIsImh0bWxfdGl0bGUiOiIwIiwicHJvYmxlbV9sYW5nX3Rjb2RlIjoiRW5nbGlzaCJ9XQ==

출처

ICPC > Regionals > Europe > Southeastern European Regional Contest > SEERC 2005 I번

  • 문제의 오타를 찾은 사람: lovinix