-
Notifications
You must be signed in to change notification settings - Fork 0
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
[이지민] - CCW, 전구와 스위치, 케빈 베이컨의 6단계 법칙, 함께 블록 쌓기 #173
Conversation
@@ -0,0 +1,19 @@ | |||
''' | |||
1도 모르겠습니다. | |||
수학 다 까먹었습니다.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저두욧^^...
for i in range(0, n - 1): | ||
if now_1[i] != after[i]: | ||
num_1 += 1 | ||
now_1[i] = 1 - now_1[i] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 - 값 좋네요
for i in range(n): | ||
for j in range(h + 1): | ||
if dp[i][j]: | ||
for s in students[i]: | ||
if j + s <= h: | ||
dp[i + 1][j + s] = (dp[i + 1][j + s] + dp[i][j]) % 10007 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
헉 여기 코드기 디게 깔꼼쓰 하네요👍
q = deque([n]) | ||
visited = [0 for _ in range(len(bacons) + 1)] | ||
num = 1 | ||
while q: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이런게 너무 신기합ㄴ디ㅏ 파이썬,,,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!
@@ -0,0 +1,19 @@ | |||
''' | |||
1도 모르겠습니다. | |||
수학 다 까먹었습니다.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
인정...
p2_x, p2_y = map(int, input().split()) | ||
p3_x, p3_y = map(int, input().split()) | ||
|
||
res = p1_x * p2_y + p2_x * p3_y + p3_x * p1_y - (p2_x * p1_y + p3_x * p2_y + p1_x * p3_y) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반복문 쓰는 것보다 이렇게 하는게 훨씬 깔끔하네요
for i in range(0, n - 1): | ||
if now_1[i] != after[i]: | ||
num_1 += 1 | ||
now_1[i] = 1 - now_1[i] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
개천재 모먼트.. ㄷㄷ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
헐 내껀데 뺏겼다,,,
|
||
|
||
n, m = map(int, input().split()) | ||
bacons = defaultdict(list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
새로운 거 알아갑니다..!!
if dp[i][j]: | ||
for s in students[i]: | ||
if j + s <= h: | ||
dp[i + 1][j + s] = (dp[i + 1][j + s] + dp[i][j]) % 10007 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+= 연산 후에
%= 연산하는 것보다
이렇게 한 줄로 나타내는게 더 편해서 이렇게 구하신건가요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵! 이게 더 연산이 빠를 것 같기두 하고요??
''' | ||
1도 모르겠습니다. | ||
수학 다 까먹었습니다.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ㅋㅋㅋㅋㅋㅋ ㅠㅠ...
global bacons | ||
q = deque([n]) | ||
visited = [0 for _ in range(len(bacons) + 1)] | ||
num = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
얘 안 쓰이는 것 같아요~~!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 그러네요 눈썰미 대박!!
now_1 = before[:] | ||
num_1 = 0 | ||
for i in range(0, n - 1): | ||
if now_1[i] != after[i]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앞이 아닌 본인을 기준으로 하는군요!
📌 from issue #170 📌
📋문제 목록📋
📍추가로 해결한 문제📍
📝메모
이번주 짱 어렵네요,,