Skip to content

Conversation

@beberiche
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented Apr 4, 2024

솔루션을 올려주셔서 감사합니다.
아래 정보가 맞는지 확인해주세요.

문제 링크: https://www.acmicpc.net/problem/12931

작성자: beberiche
언어: Java
사이트: baekjoon
풀이 설명: 
1. 고민이 필요한 문제. \`A → B\` 로 변화시키는 것이 아닌 \`B → A\` 로 바꾼다는 생각의 전환이 필요하다.

2. **베열에 있는 모든 값을 두 배 시킨다** 는 연산은 결국 배열의 모든 값이 **짝수**가 됨을 의미한다.
   따라서 B → A로 전향할 때는, 홀수가 있는지 확인하고 홀수가 있다면 \`-1\` 차감하여 짝수로 만들어주고,
   \`B\` 의 모든 값이 짝수인 경우에만 \`2\` 로 나눠주는 것으로 최소 횟수로 \`B\` 를 \`A\` 로 만드는 것이 가능하다.


@github-actions github-actions bot added Java Java baekjoon baekjoon solution 솔루션 PR labels Apr 4, 2024
Copy link
Owner

@tony9402 tony9402 left a comment

Choose a reason for hiding this comment

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

LGTM

@tony9402 tony9402 merged commit cf7ce99 into tony9402:main Jan 29, 2025
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.

2 participants