본문 바로가기

Algorithm/BaekJoon[Java]67

백준 2609 ▶ 2609번 문제 - 최대공약수와 최소공배수 ▶ 풀이방법 import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); StringTokenizer st = new StringTokenizer(br.readLine()); int a = Integer.parseInt(st.nextToken()); .. 2022. 3. 30.
백준 10430 ▶ 10430문제 - 나머지 ▶ 풀이방법 import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); StringTokenizer st = new StringTokenizer(br.readLine()); int a = Integer.parseInt(st.nextToken()); int b = Int.. 2022. 3. 30.
백준 1406 ▶ 1406문제 - 에디터 ▶ 풀이방법 - LinkedList사용(시간초과 오류 발생) import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); String str = br.readLine(); int count = Integer.parseInt(br.readLine()); LinkedList .. 2022. 3. 30.
백준 1158 ▶ 1158문제 - 요세푸스 문제 -1168 문제와 같음. 1168은 시간초과걸려서 아직 해결하지 못함 ㅜ. ▶ 풀이방법 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.StringTokenizer; public class Main { static int num, n; public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(n.. 2022. 3. 29.