Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

11-wkdghdwns199 #47

Merged
merged 7 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions wkdghdwns199/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
| 7μ°¨μ‹œ | 2024.02.20 | μŠ€νƒ,큐,덱 | <a href="https://www.acmicpc.net/problem/24511">queuestack</a> | <a href="">2024.02.20</a> |
| 8μ°¨μ‹œ | 2024.02.23 | μŠ€νƒ, 큐, 덱 | <a href="https://www.acmicpc.net/problem/12789">도킀도킀 κ°„μ‹λ“œλ¦¬λ―Έ</a> | <a href="">2024.02.23</a> |
| 9μ°¨μ‹œ | 2024.02.26 | μŠ€νƒ, 큐, 덱 | <a href="https://www.acmicpc.net/problem/2346">풍선 ν„°λœ¨λ¦¬κΈ°</a> | <a href="">2024.02.26</a> |
| 11μ°¨μ‹œ | 2024.03.03 | μŠ€νƒ, 큐, 덱 | <a href="https://www.acmicpc.net/problem/11866">μš”μ‹œν‘ΈμŠ€ 문제 0</a> | <a href="">2024.03.03</a> |

12 changes: 12 additions & 0 deletions wkdghdwns199/μŠ€νƒ_큐_덱/ACM-11866.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import sys
from collections import deque
input = sys.stdin.readline

N, K= map(int, input().split())
circle_list = deque([number for number in range(1,N+1)])
print('<', end='')
while circle_list :
circle_list.rotate(-(K-1))
print(circle_list.popleft(), end='')
if len(circle_list) != 0 : print(', ', end='')
print('>')
11 changes: 11 additions & 0 deletions wkdghdwns199/μŠ€νƒ_큐_덱/ACM-2164.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import sys
from collections import deque
input = sys.stdin.readline
N = int(input())
card_deck = deque([card for card in range(1,N+1)])

while len(card_deck) != 1 :
card_deck.popleft()
card_deck.rotate(-1)

print(card_deck[0])
23 changes: 23 additions & 0 deletions wkdghdwns199/μŠ€νƒ_큐_덱/ACM-28279.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import sys
from collections import deque
input = sys.stdin.readline
deq = deque()
N = int(input())
for _ in range(N) :
cmd = list(map(int, input().split()))
if cmd[0] == 1 :
deq.appendleft(cmd[1])
elif cmd[0] == 2 :
deq.append(cmd[1])
elif cmd[0] == 3 :
print(-1 if len(deq) == 0 else deq.popleft())
elif cmd[0] == 4 :
print(-1 if len(deq) == 0 else deq.pop())
elif cmd[0] == 5 :
print(len(deq))
elif cmd[0] == 6 :
print(1 if len(deq) == 0 else 0)
elif cmd[0] == 7 :
print(-1 if len(deq)==0 else deq[0])
elif cmd[0] == 8:
print(-1 if len(deq)==0 else deq[len(deq)-1])
23 changes: 0 additions & 23 deletions wkdghdwns199/μŠ€ν…_큐_덱/ACM-12789.py

This file was deleted.

Loading