School/Algorithm
-
[알고리즘]BucketSchool/Algorithm 2022. 2. 8. 20:44
import java.util.HashMap; import java.util.Scanner; public class Student20191023 { static int minerror = 0; static int check = 0; public static void main(String[] args) { Scanner scan = new Scanner(System.in); String in = scan.nextLine(); String [] inputarr = in.split(" "); int i, j; int input = Integer.parseInt(inputarr[0]); int bucket = Integer.parseInt(inputarr[1]); int[] numbers = new int[in..
-
[알고리즘]SYNCHRONZING CLOCKSchool/Algorithm 2021. 11. 25. 22:07
import java.util.*; public class Student20191023 { static int switches[][] = new int[10][]; //스위치 static int clock[] = new int[16]; //시계 final static int MIN = 99999; public static void main(String[] args) { // TODO Auto-generated method stub scan(); int result = solve(clock, 0); if(result >= MIN) { result = -1; } System.out.println(result); } public static void scan() { Scanner scan = new Scann..
-
[알고리즘]Vladimir's AlgorithmSchool/Algorithm 2021. 11. 8. 01:21
QuickSort와 Vladimir's Algorithm의 성능을 비교해봄. import java.util.*; public class HW3 { public static void main(String[] args) { // TODO Auto-generated method stub Random random = new Random(); int[] n = { 17, 33, 65, 129, 257, 513}; int[] size= {10000, 100000, 200000, 400000, 800000, 1600000, 3200000, 6400000}; for(int i = 0; i < size.length; i++) { long arr[] = new long[size[i]]; for (int j = 0; j <..