Skip to content

Commit

Permalink
Merge pull request #88 from AlgoLeadMe/24-seongwon030
Browse files Browse the repository at this point in the history
24-seongwon030
  • Loading branch information
seongwon030 authored Aug 21, 2024
2 parents 6b93228 + 56c033b commit 650490c
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 18 deletions.
44 changes: 26 additions & 18 deletions seongwon030/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
## ✏️ 기록

| 차시 | 날짜 | 문제유형 | 링크 | 풀이 |
| :----: | :--------: | :--------: | :-----------------------------------------------------: | :-------------------------------------------------------: |
| 1차시 | 2024.03.11 | 스택 | [쇠막대기](https://www.acmicpc.net/problem/10799) | [#1](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/2) |
| 2차시 | 2024.03.16 | BFS | [토마토](https://www.acmicpc.net/problem/7576) | [#2](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/7) |
| 3차시 | 2024.03.19 | BFS | [3차원토마토](https://www.acmicpc.net/problem/7569) | [#3](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/11) |
| 4차시 | 2024.03.25 | BFS | [숨바꼭질3](https://www.acmicpc.net/problem/13549) | [#4](https://github.com/AlgoLeadMe/AlgoLeadMe8/pull/16) |
| 5차시 | 2024.03.30 | BFS | [점프점프](https://www.acmicpc.net/problem/11060) | [#5](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/23) |
| 6차시 | 2024.04.02 | 스택 | [문자열폭발](https://www.acmicpc.net/problem/9935) | [#6](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/25) |
| 7차시 | 2024.04.05 | 스택 | [오큰수](https://www.acmicpc.net/problem/17298) | [#7](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/30) |
| 8차시 | 2024.04.12 | BFS | [결혼식](https://www.acmicpc.net/problem/5567) | [#8](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/37) |
| 9차시 | 2024.04.29 | DP | [1,2,3 더하기 3](https://www.acmicpc.net/problem/15988) | [#9](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/38) |
| 10차시 | 2024.05.07 | 수학 | [연속 합](https://www.acmicpc.net/problem/2737) | [#10](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/43) |
| 11차시 | 2024.05.07 | DP | [합분해](https://www.acmicpc.net/problem/2225) | [#11](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/44) |
| 12차시 | 2024.05.13 | 브루트포스 | [암호만들기](https://www.acmicpc.net/problem/1759) | [#12](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/50) |
| 13차시 | 2024.05.23 | 분할정복 | [피보나치 수 6](https://www.acmicpc.net/problem/11444) | [#13](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/55) |
| 14차시 | 2024.05.28 || [가운데를 말해요](https://www.acmicpc.net/problem/1655) | [#14](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/58) |
| 15차시 | 2024.06.01 || [중앙값 구하기](https://www.acmicpc.net/problem/2696) | [#15](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/61) |
| 16차시 | 2024.07.04 | DP | [연속합](https://www.acmicpc.net/problem/1912) | [#16](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/66) |
| 차시 | 날짜 | 문제유형 | 링크 | 풀이 |
| :----: | :--------: | :------------: | :-----------------------------------------------------: | :-------------------------------------------------------: |
| 1차시 | 2024.03.11 | 스택 | [쇠막대기](https://www.acmicpc.net/problem/10799) | [#1](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/2) |
| 2차시 | 2024.03.16 | BFS | [토마토](https://www.acmicpc.net/problem/7576) | [#2](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/7) |
| 3차시 | 2024.03.19 | BFS | [3차원토마토](https://www.acmicpc.net/problem/7569) | [#3](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/11) |
| 4차시 | 2024.03.25 | BFS | [숨바꼭질3](https://www.acmicpc.net/problem/13549) | [#4](https://github.com/AlgoLeadMe/AlgoLeadMe8/pull/16) |
| 5차시 | 2024.03.30 | BFS | [점프점프](https://www.acmicpc.net/problem/11060) | [#5](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/23) |
| 6차시 | 2024.04.02 | 스택 | [문자열폭발](https://www.acmicpc.net/problem/9935) | [#6](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/25) |
| 7차시 | 2024.04.05 | 스택 | [오큰수](https://www.acmicpc.net/problem/17298) | [#7](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/30) |
| 8차시 | 2024.04.12 | BFS | [결혼식](https://www.acmicpc.net/problem/5567) | [#8](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/37) |
| 9차시 | 2024.04.29 | DP | [1,2,3 더하기 3](https://www.acmicpc.net/problem/15988) | [#9](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/38) |
| 10차시 | 2024.05.07 | 수학 | [연속 합](https://www.acmicpc.net/problem/2737) | [#10](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/43) |
| 11차시 | 2024.05.07 | DP | [합분해](https://www.acmicpc.net/problem/2225) | [#11](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/44) |
| 12차시 | 2024.05.13 | 브루트포스 | [암호만들기](https://www.acmicpc.net/problem/1759) | [#12](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/50) |
| 13차시 | 2024.05.23 | 분할정복 | [피보나치 수 6](https://www.acmicpc.net/problem/11444) | [#13](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/55) |
| 14차시 | 2024.05.28 || [가운데를 말해요](https://www.acmicpc.net/problem/1655) | [#14](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/58) |
| 15차시 | 2024.06.01 || [중앙값 구하기](https://www.acmicpc.net/problem/2696) | [#15](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/61) |
| 16차시 | 2024.07.04 | DP | [연속합](https://www.acmicpc.net/problem/1912) | [#16](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/66) |
| 17차시 | 2024.07.05 | 최소스패닝트리 | [최소스패닝트리](https://www.acmicpc.net/problem/1197) | [#17](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/67) |
| 18차시 | 2024.07.08 | 최소스패닝트리 | [정복자](https://www.acmicpc.net/problem/14950) | [#18](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/69) |
| 19차시 | 2024.07.14 | 최소스패닝트리 | [전력난](https://www.acmicpc.net/problem/6497) | [#19](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/73) |
| 20차시 | 2024.07.22 | 유니온파인드 | [집합의표현 ](https://www.acmicpc.net/problem/1717) | [#20](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/76) |
| 21차시 | 2024.07.24 | DFS | [트리](https://www.acmicpc.net/problem/1068) | [#21](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/78) |
| 22차시 | 2024.07.30 | DFS | [알파벳](https://www.acmicpc.net/problem/1987) | [#22](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/80) |
| 23차시 | 2024.08.05 | DFS | [게임](https://www.acmicpc.net/problem/1103) | [#23](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/85) |
| 24차시 | 2024.08.10 | 구현 | [주사위굴리기](https://www.acmicpc.net/problem/14499) | [#24](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/66) |

---
58 changes: 58 additions & 0 deletions seongwon030/구현/주사위굴리기.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import sys
input = sys.stdin.readline

n,m,x,y,k = map(int,input().split())
arr = []
for _ in range(n):
arr.append(list(map(int,input().split())))

move = list(map(int,input().split()))

# 주사위 (서,북,윗면,오,남,아랫면) 초기값
dice = [0]*6
# k=1, 동쪽으로 이동
# k=2, 서쪽으로 이동
# k=3, 북쪽으로 이동
# k=4, 남쪽으로 이동

for i in move:
if i == 1: # 동
if y+1 < m:
y+=1
dice[0],dice[2],dice[3],dice[5] = dice[5],dice[0],dice[2],dice[3]
print(dice[2])
if arr[x][y] == 0:
arr[x][y] = dice[5]
else:
dice[5] = arr[x][y]
arr[x][y] = 0
elif i == 2: # 서
if y-1 >=0:
y-=1
dice[0],dice[2],dice[3],dice[5] = dice[2],dice[3],dice[5],dice[0]
print(dice[2])
if arr[x][y] == 0:
arr[x][y] = dice[5]
else:
dice[5] = arr[x][y]
arr[x][y] = 0
elif i == 3: # 북
if x-1 >=0:
x-=1
dice[1],dice[2],dice[4],dice[5] = dice[2],dice[4],dice[5],dice[1]
print(dice[2])
if arr[x][y] == 0:
arr[x][y] = dice[5]
else:
dice[5] = arr[x][y]
arr[x][y] = 0
elif i == 4: # 남
if x+1 < n:
x+=1
dice[1],dice[2],dice[4],dice[5] = dice[5],dice[1],dice[2],dice[4]
print(dice[2])
if arr[x][y] == 0:
arr[x][y] = dice[5]
else:
dice[5] = arr[x][y]
arr[x][y] = 0

0 comments on commit 650490c

Please sign in to comment.