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

[이지민] - 나의 인생에는 수학과 함께, 톱니바퀴(2), 이차원 배열과 연산, 루돌프의 반란 #233

Merged
merged 4 commits into from
Mar 31, 2024

Conversation

jeeminimini
Copy link
Member

📌 from issue #230 📌

📋문제 목록📋

나의 인생에는 수학과 함께: ✅
톱니바퀴(2): ✅ 
이차원 배열과 연산: ✅
루돌프의 반란: ✅

@jeeminimini jeeminimini self-assigned this Mar 31, 2024
dy = [1, 0]

queue = deque([[0, 0]])
visited = [[10000 * road_type for _ in range(n)] for _ in range(n)]
Copy link
Contributor

Choose a reason for hiding this comment

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

이렇게 해서 중간세이브(?) 같은 느낌으로 푸신 게 좋았어요

for i in range(p):
sx, sy = santas[i]
if santa_health[i] != -1:
dst = (rx - sx) ** 2 + (ry - sy) ** 2
Copy link
Contributor

Choose a reason for hiding this comment

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

제곱 연산이 부럽네요...빨리 코테언어 파이썬으로 갈아타야하는데

SURVIVAL = p


def get_closest_santa():
Copy link
Contributor

Choose a reason for hiding this comment

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

산타끼리 상호작용에서도 이 closest_santa로 부딪히는 산타를 찾을 수 있다는 거에 너무 감동했어요,,,

Comment on lines +34 to +40
for j in range(0, MAX_SIZE, 2):
if j < len(new_number) * 2:
numbers[i][j] = new_number[j // 2][0]
numbers[i][j + 1] = new_number[j // 2][1]
else:
numbers[i][j] = 0
numbers[i][j + 1] = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

이부분 인덱스 관리가 넘 깔꼼해요 대박

MIN = 1


def bfs(road_type):
Copy link
Member

Choose a reason for hiding this comment

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

road 타입 파라미터로 케이스 두 개를 모두 만족시킨 게 좋았어요!👍

Comment on lines +33 to +34
origin_1 = wheels[num][2]
origin_2 = wheels[num][6]
Copy link
Member

Choose a reason for hiding this comment

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

해당 변수 바꾸면서 연쇄적으로 푸신 게 좋았습니다!👍

Comment on lines +34 to +40
for j in range(0, MAX_SIZE, 2):
if j < len(new_number) * 2:
numbers[i][j] = new_number[j // 2][0]
numbers[i][j + 1] = new_number[j // 2][1]
else:
numbers[i][j] = 0
numbers[i][j + 1] = 0
Copy link
Member

Choose a reason for hiding this comment

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

오 MaxSize 까지 0 을 추가시키는!👍

@@ -0,0 +1,164 @@
import sys

n, m, p, c, d = map(int, sys.stdin.readline().split()) # 게임판 크기, 턴 횟수, 산타 수, 루돌프 충돌 점수, 산타 충돌 점수
Copy link
Member

Choose a reason for hiding this comment

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

저도 board(게임판)을 안 만들고 풀었으면 좋았으려나 생각이 드네요!

@jeeminimini jeeminimini merged commit f4b91a2 into main Mar 31, 2024
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.

3 participants