Study & Project ✏️/알고리즘 📋 44

백준[JAVA] 11650.좌표 정렬하기 - 자바

📖 문제 📃 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Comparator; import java.util.StringTokenizer; 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()); int[][] arr ..

백준[JAVA] 10989.수 정렬하기 3- 자바

📖 문제 📃 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { StringBuilder sb = new StringBuilder(); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int size = Integer.parseInt(br.readLine()); // Counting Sort int cnt[] = new int[10001]; /* * input * 1

백준[JAVA] 2745.진법 변환 - 자바

📖 문제 📃 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static int parseDigit(String N, int digit) { int temp = 1; int ans = 0; for (int i = N.length() - 1; i >= 0; i--) { char c = N.charAt(i); if ('A' = c) { // B - A = 1, 1 + 10(over Decimal), temp = digit ans += (c - 'A' + 10) * temp; } else { ans += (c - '0') * temp; } ..

백준[JAVA] 2750.수 정렬하기 - 자바

📖 문제 📃 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int array[]; int size = Integer.parseInt(br.readLine()); array = new int[size]; for(int i=0; i< size; i++){ array[i]..

백준[JAVA] 2355.시그마 - 자바

📖 문제 📃 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { static long sum(long A, long B) { long result = (A + B) * ((B - A + 1) / 2); System.out.println((B - A + 1) / 2); // if numbers are odd if ((B - A + 1) % 2 != 0) { result += (A + B) / 2; } return result; } public static void main(String[] ar..