BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int tc = Integer.parseInt(br.readLine()); for (int i = 0; i < tc; i++) { String[] command = br.readLine().split(" "); if (command[0].equals("add")) { int num = Integer.parseInt(command[1])-1; set.addNum(num); } } public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new Buffere..
기본값 이후의 배열을 비내림차순으로 만든 후 출력(순열) 가장 끝에서 부터 비교하는 이유: 처음 시작하는 순열의 최소값이여야 하므로 723/6541 3보다 큰수 : 6,5,4 중 가장 끝에 있는 수 선택 => 724/6531(O) => 726/5431 (X) import java.util.Scanner; public class Q10972 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int countNum = sc.nextInt(); int[] permutationList = new int[countNum]; for (int i = 0; i < countNum; i++) { permutationList[i]..