시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 205 119 113 58.854%

문제

누군가가 현금 인출기로 돈을 인출하거나 입금 할 때마다 사람의 은행 잔액을 정확하게 계산해야합니다. 본 문제는 이러한 계산을 수행하는 것입니다. 고객이 200 달러 이상의 초과 인출을 할 수 없다는 은행 규칙이 있으므로 -200달러 미만의 잔고를 인출하는 모든 인출을 중단되어야 합니다. (마이너스 기호는 당좌 대월 또는 마이너스 잔액을 나타내는 데 사용됩니다.)

입력

입력은 여러 행으로 구성되며 각 행은 거래를 나타냅니다. 각 거래는 시작 잔액을 나타내는 첫번째 정수 (-200에서 +10,000 사이) 뒤에 문자 W 또는 문자 D (인출 또는 입금)를 표현합니다. 이어지는 두 번째 정수 (5에서 400 사이)는 인출 또는 입금 할 금액을 나타냅니다. 입력은 0 W 0을 포함하는 라인으로 종료됩니다.

출력

출력은 각각의 유효한 거래에 대한 새로운 잔고를 보여주는 각 입력 행에 대해 한 행으로 구성됩니다. 인출이 -200 미만의 잔고가 남는 경우에 출력은 ‘Not allowed’이라는 단어 를 출력하여야 합니다.

예제 입력 1

10000 W 10
-200 D 300
50 W 300
0 W 0

예제 출력 1

9990
100
Not allowed
W3sicHJvYmxlbV9pZCI6IjI5NzUiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM3NDBcdWQ1ODlcdWFjNzBcdWI3OTgiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YjIwNFx1YWQ3MFx1YWMwMFx1YWMwMCBcdWQ2MDRcdWFlMDggXHVjNzc4XHVjZDljXHVhZTMwXHViODVjIFx1YjNjOFx1Yzc0NCBcdWM3NzhcdWNkOWNcdWQ1NThcdWFjNzBcdWIwOTggXHVjNzg1XHVhZTA4IFx1ZDU2MCBcdWI1NGNcdWI5YzhcdWIyZTQgXHVjMGFjXHViNzhjXHVjNzU4IFx1Yzc0MFx1ZDU4OSBcdWM3OTRcdWM1NjFcdWM3NDQgXHVjODE1XHVkNjU1X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