-
Notifications
You must be signed in to change notification settings - Fork 4
[2주차] 이혜원 #20
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주차] 이혜원 #20
Conversation
if(queue.size() ==1 ) return -1; | ||
queue.add(queue.poll() + queue.poll() *2); | ||
answer++; | ||
} |
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.
while문에서 큐 사이즈에 대한 조건문 제어로 더 깔끔한 풀인 것 같습니다 👍
|
||
visited = new boolean[n][n]; | ||
group = new int[n][n]; | ||
groupCnt = new int[n * n + 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.
배열로 미리 만들어질 수 있는 그룹에 대해 초기화해서 깔끔한 것 같아요!!
} | ||
|
||
public static void main(String[] args) { | ||
Scanner sc = new Scanner(System.in); |
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.
엇 위의 HW_1647풀이 처럼, 입력받을때 BufferedReader와 StringTokenizer를 사용하면 더 효율적으로 입력받을 수 있을것 같습니다!
max = Math.max(max, land[i-1][k]); | ||
} | ||
} | ||
land[i][j] += max; |
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(int i=0; i<prices.length; i++){ | ||
for(int j=i+1; j<prices.length; j++){ | ||
answer[i]++; | ||
if(prices[i] > prices[j]) break; | ||
} | ||
} |
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.
완전 탐색으로도.. 풀리는 문제였군요...🫥
📗 월요일
[CT] 예술성 : 구현
📗 화요일
[BOJ] 1647_도시 분할 계획 : MST
[PG] 흉부외과 또는 일반외과 의사 목록 출력하기
📗 수요일
[BOJ] 2613_줄세우기 : LIS
📗 목요일(_240919)
[PG] 42584 주식가격
[PG] 42626 더 맵게
[SQL]
📗 금요일(_240920)
[PG] 12913 땅따먹기_240920 : DP
[PG] 43163 단어 변환_240920 : BFS