Skip to content

Conversation

@YoonYn9915
Copy link
Member

@YoonYn9915 YoonYn9915 commented Jul 12, 2025

🌱WIL

이번 한 주의 소감을 작성해주세요!

  • 이번 주 간단한 구현 문제 위주로 풀었다. 크게 어려운 점은 없었고 시간이 없어서 티어가 낮은 문제들 위주로 풀어서 그런지 크게 느낀 점은 없었다.

🚀주간 목표 문제 수: 3개

푼 문제


백준 #17204. 죽음의 게임: 구현/ 실버 3

정리한 링크: (바로가기)

🚩플로우 (선택)

코드를 풀이할 때 적었던 플로우가 있나요?

🚩제출한 코드

N, K = map(int, input().split())

num_list = [int(input()) for _ in range(N)]

point = 0  # 지목을 하는 사람 (0부터 시작)
M = 0       # 지목 횟수(M번째 지목)

for i in range(N):
    target = num_list[point]    # target: 지목당한 사람
    M += 1                      # 지목했으니까 카운트 1 증가
    if target == K:
        print(M)
        break
    point = target    # 지목당한 사람이 이제는 지목하는 사람이 됨
else:
    print(-1)

백준 #17269. 이름궁합 테스트: 구현 / 실버 5

정리한 링크: (바로가기)

🚩플로우 (선택)

코드를 풀이할 때 적었던 플로우가 있나요?

🚩제출한 코드

import copy
dic = {'A':3,'B':2,'C':1,'D':2,'E':4,'F':3,'G':1,'H':3,'I':1,'J':1,'K':3,'L':1,'M':3,'N':2,'O':1,'P':2,'Q':2,'R':2,'S':1,'T':2,'U':1,'V':1,'W':1,'X':2,'Y':2,'Z':1}
N, M = map(int, input().split())
A, B = input().split()

min_len = min(N,M)
new = []
for i in range(min_len):
    new += A[i] + B[i]

if N > M:
    new += A[min_len:]
elif N < M:
    new += B[min_len:]

new_num = []
for j in new:
    new_num.append(dic[j])

while len(new_num) > 2:
    temp = []
    for k in range(1, len(new_num)):
        temp_num = new_num[k-1] + new_num[k]
        if temp_num >= 10:
            temp_num -= 10
        temp.append(temp_num)
    new_num = copy.deepcopy(temp)

print("{}%".format(new_num[0]*10 + new_num[1]))

💡TIL
배운 점이 있다면 입력해주세요

  • deepcopy()는 굳이 안 써도 될것 같고 성능 측면에서는 new_num = temp로 대체해도 될거 같다.
  • if temp_num >= 10문을 그냥 → temp_num %= 10으로 해서 조건문을 없애도 될 거 같다.

백준 #20436. ZOAC 3: 구현 / 실버 5

정리한 링크: (바로가기)

🚩플로우 (선택)

코드를 풀이할 때 적었던 플로우가 있나요?

🚩제출한 코드

def coordinate(char):
    for i in range(3):
        if char in keyboard[i]:
            j = keyboard[i].index(char)
            return (i, j)


# 쿼터식 키보드 이중 배열
keyboard = [['z', 'x', 'c', 'v', 'b', 'n', 'm'], ['a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l'],
            ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p']]

l, r = map(str, input().split())
string = str(input())
# 입력된 문자 좌표로 바꾸기
now = [coordinate(l), coordinate(r)]
word = [coordinate(i) for i in string]

sum = 0
for char in word:
    if (char[0] == 0 and char[1] >= 4) or char[1] >= 5:  # 오른손으로 입력하는 경우
        sum += abs(now[1][0] - char[0]) + abs(now[1][1] - char[1]) + 1
        now[1] = char
    else:  # 왼손으로 입력하는 경우
        sum += abs(now[0][0] - char[0]) + abs(now[0][1] - char[1]) + 1
        now[0] = char
print(sum)

Copy link
Collaborator

@Mingguriguri Mingguriguri left a comment

Choose a reason for hiding this comment

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

이번 주는 구현 문제 위주로 푸셨네요! 문제 이름들이 재미있어서 저도 한 번 풀어보고 싶다는 생각이 드네요!
이번 하나 주도 고생 많으셨습니다!

Copy link
Collaborator

@zaqquum zaqquum left a comment

Choose a reason for hiding this comment

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

이번 주 재미있는 구현 문제들을 푸셨네요 ! 저도 리스트업 해서 담에 풀어보겠습니다.b
한 주 동안 공부하시느라 고생하셨습니다

@Mingguriguri Mingguriguri merged commit cbdfd43 into main Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants