PS/boj
-
boj)6588 - 골드바흐의 추측PS/boj 2020. 9. 15. 20:27
import java.io.*; import java.util.StringTokenizer; // # 골드바흐의 추측 public class Main { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); static int a, b, n; static boolean[] prime = new boolean[1000001]; public static void main(String[] args) throws IOException { for (int i = 2; i < p..
-
boj)1929 - 소수 구하기PS/boj 2020. 9. 15. 18:58
import java.io.*; import java.util.Arrays; import java.util.StringTokenizer; // # 소수 구하기 public class boj_1929 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); public static void main(String[] args) throws IOException { StringTokenizer st = new StringTokenizer(br.readLine()); int ..
-
boj)17299 - 오등큰수PS/boj 2020. 9. 15. 17:02
import java.io.*; import java.util.Stack; import java.util.StringTokenizer; // #17299_오등큰수 public class boj_17299 { public static void main(String[] args) throws Exception { Stack s = new Stack(); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int n = Integer.parseInt(br.readLine()); int[] arr ..
-
boj)17298 - 오큰수PS/boj 2020. 9. 15. 16:10
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Stack; import java.util.StringTokenizer; public class boj_17298 { static Stack s = new Stack(); static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StringBuilder sb = new StringBuilder(); public static void main(String[] args) throws IOException { int ..
-
boj)10799 - 쇠막대기PS/boj 2020. 9. 14. 18:56
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Stack; public class boj_10799 { static Stack s = new Stack(); static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static int ans = 0; public static void main(String[] args) throws IOException { char[] chars = br.readLine().toCharArray(); for (int i = 0; i < c..
-
boj)17413 - 단어 뒤집기 2PS/boj 2020. 9. 14. 17:51
import java.io.*; import java.util.Stack; public class boj_17413 { static Stack s = new Stack(); static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StringBuilder sb = new StringBuilder(); public static void main(String[] args) throws IOException { char[] chars = br.readLine().toCharArray(); boolean isTag = false; for (char aChar : chars) { if (aChar == '') { ..
-
boj)1158 - 요세푸스 문제PS/boj 2020. 9. 14. 16:38
import java.io.*; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class boj_1158 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken(..
-
boj)1406 - 에디터PS/boj 2020. 9. 14. 01:31
import java.io.*; import java.util.Stack; public class boj_1406 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); Stack left = new Stack(); Stack right = new Stack(); String first = br.readLine(); int m = Integer.parseInt(br.readLine())..