Skip to content

[2주차] 이예진 #22

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

Merged
merged 12 commits into from
Sep 22, 2024
Prev Previous commit
Next Next commit
이예진: [BOJ] 2631 줄세우기_240918 (설명수정)
  • Loading branch information
yeahdy committed Sep 18, 2024
commit 74dabb18799b513b4a918b2fc60183a802f379d5
4 changes: 2 additions & 2 deletions BOJ/1000-10000번/YJ_2631.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* - 이미 정렬된 수는 제외하는 기준?
* 주어진 숫자들에서 오름차순으로 가장 길게 정렬된 수는 이동하지 않아도 됨
*- 최장 오름차순 정렬 수 구하는 방법?
* 현재 값과 이전 값을 비교해서 더 작은 이전 값일 경우 현재 정렬수(기본 1) +1 한다 (누적)
* 이전 값들이 많아 질 경우 현재 값과 더 작은 이전 값들 중 가장 정렬수가 높은 값을 가져와서 +1 한다
* 현재 값과 이전 값을 비교해서 이전 값이 더 작을 경우, 현재 정렬수(기본 1) +1 한다 (누적)
* 반복을 통해 현재 값과 이전 값들을 비교해서 가장 높은 정렬 수로 현재 값을 갱신한다
* 따라서 (전체 숫자 수 - 최장 오름차순 길이)를 한 나머지 개수가 움직여야 하는 갯수가 된다.
*/
public class YJ_2631 {
Expand Down