[백준] 10867번 중복 빼고 정렬하기 import java.util.Scanner; import java.util.TreeSet; public class Main { public static void main(String[] args) { Scanner kb = new Scanner(System.in); int n = kb.nextInt(); TreeSet set = new TreeSet(); for(int i=0; i 공부기록/백준 2024.01.02
[백준] 2822번 점수 계산 import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner kb = new Scanner(System.in); List answerList = new ArrayList(); List list = new ArrayList(); int[] index = new int[8]; for(int i=0; i 공부기록/백준 2024.01.01
[백준] 2910번 빈도정렬 import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.LinkedHashMap; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner kb = new Scanner(System.in); StringBuilder sb = new StringBuilder(); int N = kb.nextInt(); int C = kb.nextInt(); LinkedHashMap map = new LinkedHashMap(); for(int .. 공부기록/백준 2023.12.27
[백준] 7785번 회사에 있는 사람 import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner kb = new Scanner(System.in); int n = kb.nextInt(); HashMap map = new HashMap(); for(int i=0; i 공부기록/백준 2023.12.27
[백준] 11652번 카드 import java.util.HashMap; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner kb = new Scanner(System.in); int n = kb.nextInt(); HashMap map = new HashMap(); for(int i=0; i 공부기록/백준 2023.12.27
[백준] 11656번 접미사 배열 import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner kb = new Scanner(System.in); String s = kb.next(); String[] suffix = new String[s.length()]; for(int i=0; i 공부기록/백준 2023.12.27
[백준] 20291번 파일정리 import java.util.Scanner; import java.util.TreeMap; public class Main { public static void main(String[] args){ Scanner kb = new Scanner(System.in); StringBuilder sb = new StringBuilder(); TreeMap map = new TreeMap(); int n = kb.nextInt(); for(int i=0; i 공부기록/백준 2023.12.25
[백준] 1259번 팰린드롬수 import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner kb = new Scanner(System.in); StringBuilder sb = new StringBuilder(); while(true) { int input = kb.nextInt(); String reverseInput = new StringBuilder(String.valueOf(input)).reverse().toString(); int reverse = Integer.parseInt(reverseInput); if(input == 0) { break; }else if(input == reverse) { sb.append(".. 공부기록/백준 2023.12.25
[백준] 11931번 수 정렬하기 4 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Collections; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); ArrayList list = new ArrayLis.. 공부기록/백준 2023.12.25
[백준] 10814번 나이순 정렬 import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { static class Infor implements Comparable{ int num; String name; int age; public Infor(int num, String name, int age) { this.num = num; this.name = name; this.age = age; } @Override public int compareTo(Infor o) { if(this.age == o.age) { return this.num - o.num; } return this.age - o.age; } } p.. 공부기록/백준 2023.12.25