본문 바로가기

코딩테스트(백준)

[백준] 15649 : N과M(1) - JAVA(자바) - 사좋배 공유



import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	static ArrayList arr;
	static boolean []visit;
	public static void main(String[] args) {
		Scanner sc=  new Scanner(System.in);
		int number =sc.nextInt();
		int size = sc.nextInt();
		arr=new ArrayList();
		visit= new boolean[number+1];
		sc.nextLine();
		recul(number,size,1);
		
	}

	private static void recul(int number, int size,int index) {
		if(arr.size()==size) {
			for(int i=0;i