목록CSE (86)
한 걸음 두 걸음
Jaccardindex (Jaccardsimilarity coefficient) • 두 집합 사이의 유사도를 표현하는 지표. 0과 1 사이의 값을 가짐 • J(A, B) = |A ∩B| / |A ∪B| • 스캔된AP 각각을 집합의 원소로 봄. 2개의AP 리스트가 있을 때 이를 각 집합으로 보고 Jaccard index 값 계산 쉬운 예시 import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); HashSet hs01 = new HashSet(); HashSet hs02 = new HashSet(); HashSet hsSum = new HashSet();..
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.*; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(""); ..
지금 당장 과제에 필요한 개념은 아니긴 한데, 꽤 유용하고 중요한 알고리즘인 것 같고, 중요해보이기 때문에 셤끝나면 해볼 문제!! 문자열 집합 판별 9250 https://www.acmicpc.net/problem/9250 https://m.blog.naver.com/PostView.nhn?blogId=kks227&logNo=220992598966&proxyReferer=https%3A%2F%2Fwww.google.com%2F\ https://www.slideshare.net/JongwookChoi/c11-draft?next_slideshow=1 추가로 하고싶은거,https://www.acmicpc.net/problem/1269https://www.acmicpc.net/problem/1822
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int makeSet = sc.nextInt(); int testCase = sc.nextInt(); int result = 0; sc.nextLine(); //남아있는 개행문자를 제거하기 위해 추가함! //HashSet을 문자열로 만듭니다. HashSet hs1 = new HashSet(); for(int i = 0 ; i < makeSet; i++) { hs1.add(sc.nextLine()); } for(int i = 0 ; i < testCase; i++) { String get = sc...
전체 개요 >시작 후 가능한 시간들 중 마감시간이 가장 짧은 순 참고, import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Map; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); ArrayList meeting = new ArrayList(); for (int i = ..
뒤에서부터 오기 ``` import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int testCase = sc.nextInt(); int[] arr = new int[testCase]; for(int i = 0 ; i < testCase; i++) { arr[i] = sc.nextInt(); } Arrays.sort(arr); int result = arr[arr.length-1]; int test = 0; int sum = 0; for(int i = 2; i < arr.length+1; i++) { //System.out.println("test")..
123 -> 1 2 3 -> 1+2+3 = 6 6은 3의 배수이므로 123도 3의배수입니다. 0이 하나 이상 있어야 10의 배수죠 그다음 3의 배수인지 조건을 확인하기 위해서 위를 사용합니다. import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String numStr = sc.nextLine(); int[] arr = new int[numStr.length()]; int sum = 0; for(int i = 0 ; i < numStr.length(); i++) { sum += Integer.parseInt(numStr.charAt(i)+""); ..
import java.util.*; public class main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int count = 0; int pay = sc.nextInt(); int get = 1000-pay; count += get/500; get %= 500; count += get/100; get %= 100; count += get/50; get %= 50; count += get/10; get %= 10; count += get/5; get %= 5; count += get; System.out.println(count); } }