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

[이지민] - 주차장, 순위, 백도어 #193

Merged
merged 3 commits into from
Oct 15, 2023
Merged

[이지민] - 주차장, 순위, 백도어 #193

merged 3 commits into from
Oct 15, 2023

Conversation

jeeminimini
Copy link
Member

📌 from issue #190 📌

📋문제 목록📋

주차장: ✅
순위: ⛔️
백도어: ⛔️
탐: ❎

Copy link
Member

@soopeach soopeach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

@@ -0,0 +1,45 @@
'''
roads를 처음에 n*n 행렬로 했더니 메모리 초과가 났다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도요 ㅋㅋㅋㅋㅋ

import sys
import heapq

INF = sys.maxsize
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

옹... 이럼 얼마가 담기나요 파이썬은?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9223372036854775807
이 만큼 찍히네요 ㅋㅋ

Comment on lines +13 to +18
for k in range(1, n + 1):
for i in range(1, n + 1):
for j in range(1, n + 1):
if i != j and players[i][j] == 0:
if players[i][k] * players[k][j] > 0:
players[i][j] = players[i][k]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

지민님, 병희님 덕분에 저도 궁금증을 해결하구 갑니다..
그리고 *을 때 양수로 판정하는 부분 짱인 것 같아요

for i in range(2 * m):
car = int(sys.stdin.readline())
if car > 0:
if not all(visited):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all이 있군요 파이썬도

Comment on lines +13 to +15
for k in range(1, n + 1):
for i in range(1, n + 1):
for j in range(1, n + 1):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

플로이드 워셜로 손쉽게 풀 수 있었군요!!

distance[start] = 0

pq = []
heapq.heappush(pq, [0, start])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 pq 로 다시 풀어봐야겠네요!


if visited[start]:
continue
visited[start] = 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그냥 0 또는 1로만 처리해줘도 되는군요~~~~

for i in range(1, n + 1):
for j in range(1, n + 1):
if i != j and players[i][j] == 0:
if players[i][k] * players[k][j] > 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

와 곱한 거 좋네요...

@jeeminimini jeeminimini merged commit d96cd15 into main Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants