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

3242번 - JEZIK 다국어

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

문제

When analyzing source code in some programming language, it’s sometimes useful to know if there are some functions that will never execute. If there are, that may lead to an error in the code.

In this occasion we observe simple programming language that consists of following functions:

  • RADI: program continues to next function
  • IDI a: program goes to a-th function
  • IDI a ILI b: program goes to a-th or b-th function

Program always starts at first function.

Write the program that will calculate the number of functions that will never execute.

입력

In every line of input file there is one function, in i-th line there is i-th function.

In last line (after last function, i+1-th line) there is ‘.’ (a spot). That line is not the part of a program and is not considered function.

Number of functions will be less or equal then 10,000.

출력

In first and only line of output should be printed the number of unexecuted functions.

제한

예제 입력 1

RADI
IDI 4 ILI 6
RADI
IDI 3
RADI
IDI 8
RADI
RADI
.

예제 출력 1

2

예제 입력 2

IDI 1
RADI
.

예제 출력 2

1

예제 입력 3

RADI
IDI 4 ILI 6
RADI
IDI 3
RADI
IDI 8
RADI
RADI
. 

예제 출력 3

2

힌트

출처

Olympiad > Croatian Highschool Competitions in Informatics > 2003 > National Competition #2 - Seniors 1번

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

출처

대학교 대회

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

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