From 3d8135bec8210a6e7bb106ebb9de9ebaf59124d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=84=20KimDohyun?= <202230418@pukyong.ac.kr> Date: Mon, 8 Apr 2024 03:57:43 +0900 Subject: [PATCH 1/2] =?UTF-8?q?2024-04-08=20=EC=A0=9C=EB=A1=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pu2rile/README.md | 1 + .../\354\240\234\353\241\234.py" | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 "pu2rile/\354\212\244\355\203\235/\354\240\234\353\241\234.py" 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 From e12fa6e76808a67c37e182a1e990695657506fab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=8F=84=ED=98=84=20KimDohyun?= <163822282+pu2rile@users.noreply.github.com> Date: Mon, 8 Apr 2024 04:11:13 +0900 Subject: [PATCH 2/2] Update README.md --- pu2rile/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pu2rile/README.md b/pu2rile/README.md index 58e9799..f04c429 100644 --- a/pu2rile/README.md +++ b/pu2rile/README.md @@ -5,4 +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) | [#]() +| 4차시 | 2024.04.08 | 스택 | [제로](https://www.acmicpc.net/problem/10773) | [#15](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/15#issue-2229909173)