Skip to content

Commit

Permalink
25-alstjr7437 (#190)
Browse files Browse the repository at this point in the history
* 2024-05-18 ๋ฌธ์ œ ์„ ์ •

* 2024-05-18 solved
  • Loading branch information
alstjr7437 authored May 22, 2024
1 parent 45ac9fd commit abb7a08
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
3 changes: 2 additions & 1 deletion alstjr7437/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@
| 21์ฐจ์‹œ | 2024.04.06 | ๋น„ํŠธ๋งˆ์Šคํ‚น | <a href="https://www.acmicpc.net/problem/11723">์ง‘ํ•ฉ</a> | https://github.com/AlgoLeadMe/AlgoLeadMe-6/pull/74 |
| 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 |
| 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 |
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")

0 comments on commit abb7a08

Please sign in to comment.