전체 글
-
[백준/JAVA] 1874ETC/Algorithm 2023. 5. 21. 00:32
import java.io.*; import java.util.Stack; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); StringBuilder sb = new StringBuilder(); // N 입력 int N = Integer.parseInt(br.readLine()); Stack stack = new Stack(); int lastVa..
-
[백준/JAVA] 2805ETC/Algorithm 2023. 5. 20. 13:49
import java.io.*; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); StringTokenizer st; st = new StringTokenizer(br.readLine(), " "); int N = Integer.parseInt(st.nextToken()); int M = ..
-
[백준/JAVA] 1920ETC/Algorithm 2023. 5. 20. 13:04
백준 1920번 문제 결과 코드 import java.io.*; import java.util.HashSet; import java.util.List; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); String N = br.readLine(); String[] A = br.readLine().split(" "); String M = br.read..
-
백준 12904 JAVAETC/Algorithm 2023. 5. 20. 03:53
import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); String s = br.readLine(); String t = br.readLine(); while (t.length() > s.length()) { if (t.endsWith("A")) { t = t.substring(0, t.length() - 1); } els..
-
백준 10798 JAVAETC/Algorithm 2023. 5. 20. 00:42
import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); char[][] arr = new char[5][15]; int max = 0; for (int i = 0; i max) { ma..
-
백준 27866 JAVAETC/Algorithm 2023. 5. 19. 23:20
import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); String[] split = br.readLine().split(""); int i = Integer.parseInt(br.readLine()); bw.write(split[i-1]); bw.flush(); } }
-
백준 25314 JAVAETC/Algorithm 2023. 5. 19. 23:20
import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int n = Integer.parseInt(br.readLine()) / 4; for (int i = 0; i < n; i++) { bw.write("long "); } bw.write("int"); bw.flush(); } }
-
백준 25304 JAVAETC/Algorithm 2023. 5. 19. 23:19
import java.io.*; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int x = Integer.parseInt(br.readLine()); int n = Integer.parseInt(br.readLine()); int sum = 0; for (int i = 0; i < n..