diff --git a/pu2rile/README.md b/pu2rile/README.md index 1a26feb..58e9799 100644 --- a/pu2rile/README.md +++ b/pu2rile/README.md @@ -5,3 +5,4 @@ | 1차시 | 2024.03.24 | DP | [평범한 배낭](https://www.acmicpc.net/problem/12865) | [#3](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/3#issue-2205834078)| | 2차시 | 2024.03.29 | 구현 | [OX퀴즈](https://www.acmicpc.net/problem/8958) | [#6](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/6#issue-2214931034)| | 3차시 | 2024.04.02 | 문자열 | [크로아티아 알파벳](https://www.acmicpc.net/problem/8958) | [#10](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/10#issue-2220631332) +| 4차시 | 2024.04.08 | 스택 | [제로](https://www.acmicpc.net/problem/10773) | [#]() diff --git "a/pu2rile/\354\212\244\355\203\235/\354\240\234\353\241\234.py" "b/pu2rile/\354\212\244\355\203\235/\354\240\234\353\241\234.py" new file mode 100644 index 0000000..f02b9be --- /dev/null +++ "b/pu2rile/\354\212\244\355\203\235/\354\240\234\353\241\234.py" @@ -0,0 +1,9 @@ +k = int(input()) +stack = [] +for _ in range(k): + n = int(input()) + if n == 0: + stack.pop() + else: + stack.append(n) +print(sum(stack)) \ No newline at end of file