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
- ํ๋ก๊ทธ๋๋จธ์ค
- ์ ํจ์ค ์ค์ผ์ค๋ฌ
- Kafka
- nGrinder
- ํ์ดํผ๋ฐ์ด์
- ํ๋ก๊ทธ๋๋จธ์ค ์ปฌ๋ฌ๋ง๋ถ
- jvm ๋ฐ๋ฐ๋ฅ๊น์ง ํํค์น๊ธฐ
- s3 ์ด๋ฏธ์ง ๋ค์ด๋ก๋
- docker
- s3 log ์ ์ฅ
- redis ํ ์คํธ์ฝ๋
- prod docker-compose
- ํ๋ก๊ทธ๋๋จธ์ค ํฉ์นํ์์๊ธ
- ๋ค์ค ์ปจํ ์ด๋
- docker-compose kafka
- ์ ํจ์ค ๋น๋ ์ค๋ฅ
- Codedeploy ์ค๋ฅ
- private subnet ec2 ๋ก์ปฌ ์ ์
- docker compose
- ์๋ฒ ํฐ์ง๋ ๋์ปค ์ฌ์คํ
- AWS Certified Solutions Architect - Associate
- ์๋ฐ
- Entity
- s3 ์ด๋ฏธ์ง ์ ์ฅ
- ์คํํ๋ ๋ฏธ์ค
- aws ์ฟ ํฐ
- docker ps -a
- JPA
- aws saa ํฉ๊ฒฉ
- redis ์กฐํ
Archives
- Today
- Total
๐๐ข๐๐ โ๐๐๐ ๐๐๐ก๐๐ ๐๐๐๐โง
[Python] ๋ฐฑ์ค 1916 & ๋ฐฑ์ค 2309 ๋ณธ๋ฌธ
๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ด๐ป/[๐๐ฒ๐ญ๐ก๐จ๐ง] ๐๐ฅ๐ ๐จ๐ซ๐ข๐ญ๐ก๐ฆ
[Python] ๋ฐฑ์ค 1916 & ๋ฐฑ์ค 2309
๐คRyusun๐ค 2023. 8. 27. 23:48# ๋ฐฑ์ค 1916
import heapq
import sys
input = sys.stdin.readline
n= int(input())
m = int(input())
graph = [[] for _ in range(n+1)]
for _ in range(m):
a, b, c = map(int, input().split())
graph[a].append([b, c])
start, end = map(int, input().split())
def dijkstra(start, end):
queue = []
min_dist = [1e9] * (n + 1)
heapq.heappush(queue, [0, start])
min_dist[start] = 0
while queue:
current_dist, current_node = heapq.heappop(queue)
if min_dist[current_node] > current_dist:
min_dist[current_node] = current_dist
if current_node == end:
return min_dist[end]
for next_node, weight in graph[current_node]:
cost= min_dist[current_node] + weight
if cost < min_dist[next_node]:
min_dist[next_node] = cost
heapq.heappush(queue, [cost, next_node])
print(dijkstra(start,end))
# ๋ฐฑ์ค 2309
import sys
input = sys.stdin.readline
heights = []
for _ in range(9):
heights.append(int(input()))
possible = []
def dfs(depth):
if depth == 7 :
if sum(possible) == 100:
for i in sorted(possible):
print(i)
exit()
else:
return
for i in range(depth, 9):
possible.append(heights[i])
dfs(depth+1)
possible.pop()
dfs(0)
'๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ด๐ป > [๐๐ฒ๐ญ๐ก๐จ๐ง] ๐๐ฅ๐ ๐จ๐ซ๐ข๐ญ๐ก๐ฆ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Python] ๋ฐฑ์ค 16956 (0) | 2023.08.29 |
---|---|
[Python] ๋ฐฑ์ค 16165 & ๋ฐฑ์ค 2908 (0) | 2023.08.28 |
[Python] ๋ฐฑ์ค 1743 & 1303 (0) | 2023.08.27 |
[Python] ๋ฐฑ์ค 5014 & ํ๋ก๊ทธ๋๋จธ์ค ์คํ์ฑํ ๋ฐฉ (0) | 2023.07.31 |
[Python] ๋ฐฑ์ค 1759 & ๋ฐฑ์ค 1987 (0) | 2023.07.26 |