We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
start
package main.java.com.poogle.BOJ.Q15650; import java.util.Scanner; public class Main { static int[] a = new int[10]; // 순서로 풀이 static void go(int index, int start, int n, int m) { if (index == m) { for (int i = 0; i < m; i++) { System.out.print(a[i]); if (i != m - 1) System.out.print(' '); } System.out.println(); return; } for (int i = start; i <= n; i++) { a[index] = i; go(index + 1, i + 1, n, m); } } //선택으로 풀이 static void go(int index, int selected, int n, int m) { if (selected == m) { for (int i = 0; i < m; i++) { System.out.print(a[i]); if (i != m - 1) System.out.print(' '); } System.out.println(); return; } if (index > n) return; //선택했을 때 a[selected] = index; go(index + 1, selected + 1, n, m); //선택하지 않았을 때 a[selected] = 0; go(index + 1, selected, n, m); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); //순서 go(0, 1, n, m); //선택 go(1, 0, n, m); } }
The text was updated successfully, but these errors were encountered:
18ad448
BOJ: 15650 풀이 수정
93c28de
Issue #56
suhyunsim
No branches or pull requests
문제
핵심 아이디어
순서
start
: index 번째에 올 수 있는 수는 start - n선택
어려운 점, 실수
풀이
The text was updated successfully, but these errors were encountered: