-
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
[이지민] - 222-풀링, 종이의 개수, N번째 큰 수, 택배 배달과 수거하기 #212
Conversation
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.
고생하셨어요!
int result = 0; | ||
|
||
while (cnt < n) { | ||
Arrays.sort(numbers, Comparator.comparing((ArrayList<Integer> num1) -> num1.get(num1.size() -1)).reversed()); |
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 x until x + divisor step divisor / 3) { | ||
for (j in y until y + divisor step divisor / 3) { | ||
setRecursion(papers, i, j, divisor / 3) | ||
} | ||
} |
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 (n > 1) { | ||
for (int i = 0; i < n; i += 2) { | ||
for (int j = 0; j < n; j += 2) { | ||
int [] polling = {numbers[i][j], numbers[i + 1][j], numbers[i][j + 1], numbers[i + 1][j + 1]}; | ||
Arrays.sort(polling); | ||
numbers[i / 2][j / 2] = polling[2]; | ||
} | ||
} | ||
|
||
n /= 2; | ||
} |
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 (cnt < n) { | ||
Arrays.sort(numbers, Comparator.comparing((ArrayList<Integer> num1) -> num1.get(num1.size() -1)).reversed()); | ||
|
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.
끝에만 넣구 sort 하시는 생각 굿입니다!👍👍
for (i in x until x + divisor step divisor / 3) { | ||
for (j in y until y + divisor step divisor / 3) { | ||
setRecursion(papers, i, j, divisor / 3) | ||
} | ||
} |
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 (n > 1) { | ||
for (int i = 0; i < n; i += 2) { | ||
for (int j = 0; j < n; j += 2) { | ||
int [] polling = {numbers[i][j], numbers[i + 1][j], numbers[i][j + 1], numbers[i + 1][j + 1]}; | ||
Arrays.sort(polling); | ||
numbers[i / 2][j / 2] = polling[2]; | ||
} | ||
} | ||
|
||
n /= 2; | ||
} |
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 #210 📌
📋문제 목록📋