PS
-
boj)1431PS/boj 2020. 8. 28. 17:34
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()); ArrayList list = new ArrayList(); for (int i = 0; i < N; i++) { list.add(br.readLine()); } // 정렬 Collections.sort(list, n..
-
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..