Skip to content

Commit

Permalink
2024-05-18 solved
Browse files Browse the repository at this point in the history
  • Loading branch information
alstjr7437 committed May 18, 2024
1 parent 6b830f0 commit 0f376b1
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion alstjr7437/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
| 22μ°¨μ‹œ | 2024.04.13 | BFS | <a href="https://www.acmicpc.net/problem/11724">μ—°κ²° μš”μ†Œμ˜ 개수</a> | https://github.com/AlgoLeadMe/AlgoLeadMe-6/pull/78 |
| 23μ°¨μ‹œ | 2024.05.01 | 큐 | <a href="https://school.programmers.co.kr/learn/courses/30/lessons/42587">ν”„λ‘œμ„ΈμŠ€</a> | https://github.com/AlgoLeadMe/AlgoLeadMe-6/pull/79 |
| 24μ°¨μ‹œ | 2024.05.14 | BFS | <a href="https://www.acmicpc.net/problem/7576">ν† λ§ˆν† </a> | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/187 |
| 25μ°¨μ‹œ | 2024.05.18 | νž™ | <a href="https://www.acmicpc.net/problem/5430">AC</a> | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/190 |
| 25μ°¨μ‹œ | 2024.05.18 | 덱 | <a href="https://www.acmicpc.net/problem/5430">AC</a> | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/190 |
41 changes: 41 additions & 0 deletions alstjr7437/덱/AC.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from collections import deque
import sys
input = sys.stdin.readline

t = int(input())

for _ in range(t):
temp_reverse = False
error = 0

p = input()
n = int(input())
x = deque(input().strip()[1:-1].split(','))

if n == 0 :
x = deque()

for i in p:
if i == 'R':
if temp_reverse :
temp_reverse = False
else :
temp_reverse = True

if i == "D":
if len(x) == 0:
error = 1
break
else :
if temp_reverse :
x.pop()
else :
x.popleft()

if temp_reverse :
x.reverse()

if error == 0 :
print(f"[{','.join(str(i) for i in x)}]")
else :
print("error")
Empty file removed alstjr7437/νž™/AC.py
Empty file.

0 comments on commit 0f376b1

Please sign in to comment.