목록정렬 (2)
happy coding
[java] 1181. 단어정렬
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); Set words = new HashSet(); // 중복 제거를 위한 Set 사용 for (int i = 0; i < N; i++) { words.add(br.readLine()); // 중복 제거된 단어 저장 } List sortedWords = new ArrayList(words); // ..
coding study/baekjoon
2023. 8. 13. 16:20
[java] 10814. 나이순 정렬
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); String[][] data = new String[N][2]; for (int i=0 ; i Integer.parseInt(arr[0]))); for (int i=0 ; i
coding study/baekjoon
2023. 8. 13. 16:08