Notice
Recent Posts
Recent Comments
Link
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- ์๋ฒ ํฐ์ง๋ ๋์ปค ์ฌ์คํ
- docker compose
- ์คํํ๋ ๋ฏธ์ค
- ํ๋ก๊ทธ๋๋จธ์ค ์ปฌ๋ฌ๋ง๋ถ
- docker-compose kafka
- JPA
- jvm ๋ฐ๋ฐ๋ฅ๊น์ง ํํค์น๊ธฐ
- ์ ํจ์ค ์ค์ผ์ค๋ฌ
- aws ์ฟ ํฐ
- docker ps -a
- ๋ค์ค ์ปจํ ์ด๋
- ์ ํจ์ค ๋น๋ ์ค๋ฅ
- Kafka
- redis ์กฐํ
- redis ํ ์คํธ์ฝ๋
- s3 log ์ ์ฅ
- s3 ์ด๋ฏธ์ง ๋ค์ด๋ก๋
- ์๋ฐ
- private subnet ec2 ๋ก์ปฌ ์ ์
- s3 ์ด๋ฏธ์ง ์ ์ฅ
- ํ์ดํผ๋ฐ์ด์
- ํ๋ก๊ทธ๋๋จธ์ค
- nGrinder
- ํ๋ก๊ทธ๋๋จธ์ค ํฉ์นํ์์๊ธ
- Codedeploy ์ค๋ฅ
- aws saa ํฉ๊ฒฉ
- Entity
- docker
- AWS Certified Solutions Architect - Associate
- prod docker-compose
Archives
- Today
- Total
๐๐ข๐๐ โ๐๐๐ ๐๐๐ก๐๐ ๐๐๐๐โง
[Python] ๋ฐฑ์ค 14923 ๋ฏธ๋กํ์ถ & ํ๋ก๊ทธ๋๋จธ์ค JadenCase ๋ฌธ์์ด ๋ง๋ค๊ธฐ ๋ณธ๋ฌธ
๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ด๐ป/[๐๐ฒ๐ญ๐ก๐จ๐ง] ๐๐ฅ๐ ๐จ๐ซ๐ข๐ญ๐ก๐ฆ
[Python] ๋ฐฑ์ค 14923 ๋ฏธ๋กํ์ถ & ํ๋ก๊ทธ๋๋จธ์ค JadenCase ๋ฌธ์์ด ๋ง๋ค๊ธฐ
๐คRyusun๐ค 2023. 9. 17. 13:29๋ฐฑ์ค 14923
# ๋ฐฑ์ค 14923 ๋ฏธ๋กํ์ถ
from collections import deque
n, m = map(int, input().split())
Hx, Hy = map(int, input().split())
Ex, Ey = map(int, input().split())
graph = [list(map(int, input().split())) for _ in range(n)]
visited = [[[0] * 2 for _ in range(m)] for _ in range(n)]
d_row = [0, -1, 0, 1]
d_col = [1, 0, -1, 0]
def solution(Hx, Hy):
queue = deque()
x, y = Hx-1, Hy-1
queue.append([x,y, 0])
visited[x][y][0] = 0
while queue:
x, y, w = queue.popleft()
if x == Ex-1 and y == Ey-1:
return visited[x][y][w]
for i in range(4):
nx = d_row[i] + x
ny = d_col[i] + y
if 0<= nx < n and 0 <= ny < m :
if graph[nx][ny] == 0 and visited[nx][ny][w]==0: # ๋ค์๋
ธ๋๊ฐ 0์ด๊ณ ์์ง ๋ฐฉ๋ฌธ์ํ๋ค๋ฉด
queue.append([nx,ny,w])
visited[nx][ny][w] = visited[x][y][w]+1
elif graph[nx][ny] == 1 and w == 0: # ๋ค์ ๋
ธ๋๊ฐ 1(๋ฒฝ)์ด๊ณ ๊ทธ ๋ฒฝ์ ์ ๋ถ์ ์ํ๋ผ๋ฉด
visited[nx][ny][w+1] = visited[x][y][w] + 1
queue.append([nx, ny, w+1])
else:
return -1
print(solution(Hx, Hy))
ํ๋ก๊ทธ๋๋จธ์ค JadenCase ๋ฌธ์์ด ๋ง๋ค๊ธฐ
๋ด ์ฝ๋
def solution(s):
s = s.lower()
new_list = []
str_list = s.split(" ")
for i in str_list:
if not i[0:1].isdigit():
a = i[0:1].upper()
i = "".join([a, i[1:]])
new_list.append(i)
return " ".format(" ".join(new_list))
solution("3people unFollowed me")
๋ ์ฌ์ด ์ฝ๋
def solution2(s):
return ' '.join([word.capitalize() for word in s.split(" ")])
solution2("3people unFollowed me")
ํจ์ .capitalize()๋ฅผ ์ฐ๋ฉด ํ๋ฐฉ์ ํด๊ฒฐ๋๋ค...ใ
'๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ด๐ป > [๐๐ฒ๐ญ๐ก๐จ๐ง] ๐๐ฅ๐ ๐จ๐ซ๐ข๐ญ๐ก๐ฆ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Python] ํ๋ก๊ทธ๋๋จธ์ค ๊ตฌ๋ช ๋ณดํธ & ํ๋ก๊ทธ๋๋จธ์ค ๋คํธ์ํฌ (0) | 2023.09.20 |
---|---|
[Python] ํ๋ก๊ทธ๋๋จธ์ค ์ซ์์ ํํ & ๋ฐฑ์ค 6593 ์๋ฒ๋น๋ฉ (1) | 2023.09.18 |
[Python] ํฌํฌ์ธํฐ ์๊ณ ๋ฆฌ์ฆ & ๋ฐฑ์ค 2203 ์๋ค์ ํฉ2 (0) | 2023.09.16 |
[Python] ๋ฐฑ์ค 2210 (0) | 2023.09.07 |
[Python] ํ๋ก๊ทธ๋๋จธ์ค ํ๊น๋๋ฒ & ๋ฐฑ์ค 7576 ํ ๋งํ (0) | 2023.09.06 |