본문 바로가기

알고리즘 & 자료구조569

백준 1157 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main1157 { public static void main(String[] args) throws IOException { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); String arr = bf.readLine(); int[] history = new int[26]; int max = 0; int cnt = 0; char result = 0; for (int i = 0; i < arr.length(); i++) { if (is.. 2021. 7. 14.
백준 2675 import java.util.Scanner; public class Main2675 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int T = s.nextInt(); String[] S = new String[T]; String[] P = new String[T]; for(int i=0; i 2021. 7. 14.
프림 알고리즘(Prim Path)-(1) 보호되어 있는 글 입니다. 2021. 7. 14.
백준 10809 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main10809 { public static void main(String[] args) throws IOException { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); String S = bf.readLine(); int[] alpha = new int[26]; for (int i = 0; i < alpha.length; i++) { alpha[i] = -1; } for (int i = 0; i < S.length(); i++.. 2021. 7. 13.
백준 11720 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main11720 { public static void main(String[] args) throws IOException { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(bf.readLine()); String num = bf.readLine(); int number =0; int sum = 0; for(int i=0; i 2021. 7. 13.
크루스칼 알고리즘(KruskalPath) 보호되어 있는 글 입니다. 2021. 7. 13.