Skip to content

Commit

Permalink
Merge pull request #2 from AlgoLeadMe/1-Dolchae
Browse files Browse the repository at this point in the history
1-Dolchae
  • Loading branch information
9kyo-hwang authored Nov 9, 2023
2 parents 3418d62 + c75ba99 commit 40ec044
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Dolchae/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
## ✏️ 기둝

| μ°¨μ‹œ | λ‚ μ§œ | λ¬Έμ œμœ ν˜• | 링크 | 풀이 |
|:----:|:---------:|:----:|:-----:|:----:|
| 1μ°¨μ‹œ | 2023.10.27 | BFS | - | - |
---
| μ°¨μ‹œ | λ‚ μ§œ | λ¬Έμ œμœ ν˜• | 링크 | 풀이 |
|:---- :|:----------:|:-----:|:-----------------------------------------------------:|:------------------------------------------------------:|
| 1μ°¨μ‹œ | 2023.11.08 | μŠ€νƒ | [1874 μŠ€νƒ μˆ˜μ—΄] https://www.acmicpc.net/problem/1874 | [#2] https://github.com/AlgoLeadMe/AlgoLeadMe-3/pull/2 |
22 changes: 22 additions & 0 deletions Dolchae/μŠ€νƒ/1874 μŠ€νƒμˆ˜μ—΄.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
n = int(input())
stack = []
ans = []
cur = 1
k=1
for _ in range(n):
input_num = int(input())
while cur <= input_num:
stack.append(cur)
ans.append("+")
cur += 1

if stack[-1] == input_num:
stack.pop()
ans.append("-")
else:
k = 0
if k==1:
for i in ans:
print(i)
else:
print("NO")

0 comments on commit 40ec044

Please sign in to comment.