목록순열 (4)
hara
https://www.acmicpc.net/problem/1722 import java.util.Scanner; public class a1722_2 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int check = sc.nextInt(); long[] f = new long[num+1]; boolean[] c = new boolean[num+1]; f[0] = 1; for(int i=1; i
https://www.acmicpc.net/problem/10974 import java.util.Scanner; public class a10974 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int[] arr = new int[num]; for(int i=0 ; i= arr[i]) { i--; } if(i = i && arr[j]
https://www.acmicpc.net/problem/10973 import java.util.Scanner; public class a10973 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); int[] arr = new int[num]; for(int i=0 ; i0 && arr[i-1] = arr[i-1]) { j--; } int temp = arr[i-1]; arr[i-1] = arr[j]; arr[j] = temp; j = num - 1; while(i < j) { temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; i++;..
https://www.acmicpc.net/problem/10972 import java.util.Scanner; public class a10972 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = Integer.parseInt(sc.nextLine()); int[] arr = new int[num]; for(int i=0 ; i0 && arr[i-1] >= arr[i]) { i--; } if(i = i && arr[j]