Skip to content

Commit

Permalink
2024.02.20 solved
Browse files Browse the repository at this point in the history
  • Loading branch information
JangHongJoon committed Feb 20, 2024
1 parent db22a6a commit 7a842fb
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions wkdghdwns199/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
| 4μ°¨μ‹œ | 2024.01.30 | μ•½μˆ˜, λ°°μˆ˜μ™€ μ†Œμˆ˜ | <a href="https://www.acmicpc.net/problem/4134">λ‹€μŒ μ†Œμˆ˜</a> | <a href="">2024.01.30</a> |
| 5μ°¨μ‹œ | 2024.02.14 | μ•½μˆ˜, λ°°μˆ˜μ™€ μ†Œμˆ˜ | <a href="https://www.acmicpc.net/problem/17103">λ‹€μŒ μ†Œμˆ˜</a> | <a href="">2024.02.14</a> |
| 6μ°¨μ‹œ | 2024.02.16 | μ•½μˆ˜, λ°°μˆ˜μ™€ μ†Œμˆ˜ | <a href="https://www.acmicpc.net/problem/13909">μ°½λ¬Έ λ‹«κΈ°</a> | <a href="">2024.02.16</a> |
| 7μ°¨μ‹œ | 2024.02.20 | μŠ€νƒ,큐,덱 | <a href="https://www.acmicpc.net/problem/24511">queuestack</a> | <a href="">2024.02.16</a> |

10 changes: 10 additions & 0 deletions wkdghdwns199/μŠ€νƒ/ACM-10773.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
N = int(input())
stack = []
while N:
N-=1
n = int(input())
if (n==0) : stack.pop()
else : stack.append(n)


print(sum(stack))
21 changes: 21 additions & 0 deletions wkdghdwns199/μŠ€νƒ/ACM-24511.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from collections import deque

# 데이터 λ°›κΈ°
N = int(input())
queue_stack = list(map(int, input().split()))
data = list(map(int, input().split()))
n = int(input())
numbers = list(map(int, input().split()))

answer = deque()

for i in range(N) :
if queue_stack[i] == 0:
answer.append(data[i])

for number in numbers :
answer.appendleft(number)


for _ in range(n) :
print(answer.pop(), end=' ')
15 changes: 15 additions & 0 deletions wkdghdwns199/μŠ€νƒ/ACM-28278.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from collections import deque
import sys
N = int(sys.stdin.readline())
deq = deque([])
while N :
N-=1
n = list(map(int, sys.stdin.readline().split()))
if len(n) > 1 : deq.appendleft(n[1])
else :
if (n[0] == 2) :
if (len(deq) == 0) : print(-1)
else : print(deq.popleft())
elif (n[0] == 3) : print(len(deq))
elif (n[0] == 4) : print(1 if len(deq) == 0 else 0)
elif (n[0] == 5) : print(deq[0] if len(deq) !=0 else -1)

0 comments on commit 7a842fb

Please sign in to comment.