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 kafka
- ํ์ดํผ๋ฐ์ด์
- ํ๋ก๊ทธ๋๋จธ์ค ํฉ์นํ์์๊ธ
- ์๋ฒ ํฐ์ง๋ ๋์ปค ์ฌ์คํ
- docker compose
- nGrinder
- ๋ค์ค ์ปจํ ์ด๋
- aws saa ํฉ๊ฒฉ
- ์ ํจ์ค ์ค์ผ์ค๋ฌ
- Kafka
- s3 ์ด๋ฏธ์ง ๋ค์ด๋ก๋
- docker ps -a
- private subnet ec2 ๋ก์ปฌ ์ ์
- redis ์กฐํ
- Entity
- ์คํํ๋ ๋ฏธ์ค
- redis ํ ์คํธ์ฝ๋
- prod docker-compose
- ํ๋ก๊ทธ๋๋จธ์ค
- aws ์ฟ ํฐ
- jvm ๋ฐ๋ฐ๋ฅ๊น์ง ํํค์น๊ธฐ
- Codedeploy ์ค๋ฅ
- JPA
- AWS Certified Solutions Architect - Associate
- docker
- ์๋ฐ
- s3 ์ด๋ฏธ์ง ์ ์ฅ
- s3 log ์ ์ฅ
Archives
- Today
- Total
๐๐ข๐๐ โ๐๐๐ ๐๐๐ก๐๐ ๐๐๐๐โง
[Python] ๋ฐฑ์ค 1283 & ๋ฐฑ์ค 3055 ๋ณธ๋ฌธ
๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ด๐ป/[๐๐ฒ๐ญ๐ก๐จ๐ง] ๐๐ฅ๐ ๐จ๐ซ๐ข๐ญ๐ก๐ฆ
[Python] ๋ฐฑ์ค 1283 & ๋ฐฑ์ค 3055
๐คRyusun๐ค 2023. 6. 10. 23:301283
๋ฌธ์ ๋ ์ฌ์ ์ง๋ง ํ๊ธฐ ๊น๋ค๋ก์ ๋ ๋ฌธ์ ใ ใ
๋ช์๊ฐ๋ง์ ์ง๋ฆฟํ๊ฒ ์ฑ๊ณต
# ๋ฐฑ์ค 1283
n = int(input())
dict = {}
for _ in range(n):
word = str(input()).rstrip("\n")
upper_word = word.upper()
if " " not in word:
if upper_word[0] not in dict:
dict[upper_word[0]] = 1
print("[" + word[0] + "]" + word[1:])
continue
else:
for i in range(len(word)):
if i == len(word)-1 and upper_word[i] in dict:
print(word)
elif upper_word[i] not in dict:
dict[upper_word[i]] = 1
print(word[:i] +"[" + word[i] + "]" + word[i+1:])
break
else:
flag = False
word_list= word.split(' ')
split_word_list = upper_word.split(' ')
for n in range(len(split_word_list)):
if split_word_list[n][0] not in dict:
dict[split_word_list[n][0]] = 1
word_list[n] = "[" + word_list[n][0] + "]" + word_list[n][1:]
print(" ".join(word_list))
flag = True
break
if flag:
continue
else:
for n in range(len(split_word_list)):
if flag :
break
for w in range(len(split_word_list[n])):
if split_word_list[n][w] not in dict:
dict[split_word_list[n][w]] = 1
word_list[n] = word_list[n][:w] + "[" + word_list[n][w] + "]" + word_list[n][w+1:]
print(" ".join(word_list))
flag = True
break
elif n == len(split_word_list) -1 and w == len(split_word_list[n])-1 and split_word_list[n][w] in dict:
print(word)
#3055 ๊ณ ์ด๋์น
from collections import deque
n, m = map(int, input().split())
graph = []
for _ in range(n):
graph.append(list(input().rstrip("\n")))
visited = [[0] *m for _ in range(n)]
queue = deque()
d_row = [0, -1, 0, 1]
d_col = [1, 0, -1, 0]
def bfs(dx,dy):
while queue:
x, y = queue.popleft()
if graph[dx][dy] == 'S':
return visited[dx][dy]
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] == '.' or graph[nx][ny] == 'D') and graph[x][y] == 'S':
graph[nx][ny] = 'S'
visited[nx][ny] = visited[x][y] + 1
queue.append([nx, ny])
elif (graph[nx][ny] == '.' or graph[nx][ny] == 'S') and graph[x][y] == '*':
graph[nx][ny] = '*'
queue.append([nx,ny])
return "KAKTUS"
x, y = 0, 0
for i in range(n):
for j in range(m):
if graph[i][j]== 'S':
queue.append([i,j])
elif graph[i][j] == 'D':
x, y = i, j
for w in range(n):
for v in range(m):
if graph[w][v] == '*':
queue.append([w, v])
print(bfs(x,y))
'๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ด๐ป > [๐๐ฒ๐ญ๐ก๐จ๐ง] ๐๐ฅ๐ ๐จ๐ซ๐ข๐ญ๐ก๐ฆ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Python] ๋ฐฑ์ค 1461 & ๋ฐฑ์ค 2212 (0) | 2023.06.25 |
---|---|
[Python] ๋ฐฑ์ค 2110 & ๋ฐฑ์ค 1238 (0) | 2023.06.21 |
[Python] ๋ฐฑ์ค 11004 & ๋ฐฑ์ค 10282 (0) | 2023.06.09 |
[Python] ๋ฐฑ์ค 11650 & ๋ฐฑ์ค 2798 & ๋ฐฑ์ค 5597 (0) | 2023.06.06 |
[Python] ๋ฐฑ์ค 1302 & ๋ฐฑ์ค 1543 (0) | 2023.06.05 |