PS/boj
-
boj)1181PS/boj 2020. 8. 28. 16:38
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; 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()); HashSet set = new HashSet(); for (int i = 0; i < N; i++) { set.add(br.readLine()); } ArrayList list = new ArrayList(set);..
-
boj)5585PS/boj 2020. 8. 24. 23:24
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { static int T, money, count; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); T = Integer.parseInt(br.readLine()); money = 1000 - T; count += money / 500; count += money % 500 /100; count += money % 500 % 100 / 50; count += money %..
-
boj)10162PS/boj 2020. 8. 24. 22:55
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { static int A, B, C; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int T = Integer.parseInt(br.readLine()); if (T%10 > 0) { System.out.println(-1); } else { A = T/300; T -= A * 300; B = T/60; T -= B * 60; C = T/10; System.out.pr..
-
boj)11966PS/boj 2020. 8. 24. 18:13
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); long N = Integer.parseInt(br.readLine()); int pow = 1; boolean b = false; if (N == pow) { System.out.println(1); } else { for (int i = 0; i < 30; i++) { pow *= 2; if (N == pow) { b ..
-
boj)18110PS/boj 2020. 8. 24. 15:01
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; public class Main { static int N, sum, topSum, bottomSum; static int[] arr; static double answer, personNum; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); N = Integer.parseInt(br.readLine()); arr = new int[N]; for (int i =..
-
boj)1049PS/boj 2020. 8. 24. 14:24
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { static int N, M, aMin, bMin, price, answer; static int[] arr, brr; static int getMin(int[] arr) { int min = arr[0]; for (int value : arr) { if (value < min) { min = value; } } return min; } public static void main(String[] args) throws Exception { BufferedReader br = new Buffere..
-
boj)1475PS/boj 2020. 8. 23. 16:00
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String N = br.readLine(); int[] numArr = new int[10]; // 0~9 for (int i = 0; i < N.length(); i++) { numArr[N.charAt(i) - '0']++; } int sum69 = numArr[6] + numArr[9]; // 6,9의 합 int r..
-
boj)1919PS/boj 2020. 8. 23. 15:34
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { /** * #1919) 에너그램 만들기 * 두 개의 단어가 순서를 바꿔서 같아질 수 있으면 이걸 에너그램이라고 함 * 두 단어가 서로 애너그램 관계에 있도록 만들기 위해서 제거해야 하는 문자의 최소 개수 * 문자를 제거할 때에는 아무 위치에 있든 상관 없음 * 문자 A,B에서 둘다 제거가능 */ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String A = br.r..