Computer Science (CS)

Computer Science (CS)/알고리즘

[백준/Java] 3009번 네 번째 점

문제 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine(), " "); int x1 = Integer.parseInt(st.nextToken()); int..

Computer Science (CS)/알고리즘

[백준/Java] 직사각형에서 탈출

문제 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int x = Integer.parseInt(st.nextToken()); int y = I..

Computer Science (CS)/알고리즘

[백준/Java] 27323번 직사각형

문제 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int A = Integer.parseInt(br.readLine()); int B = Integer.parseInt(br.readLine()); System.out.print(A*B); br.close(); } } 메모리 14116KB 시간 120ms

Computer Science (CS)/알고리즘

[백준/Java] 11653번 소인수분해

문제 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); int i = 2; while(N != 1){ if(N%i == 0){ System.out.println(i); N = ..

Computer Science (CS)/알고리즘

[백준/Java] 2581번 소수

문제 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int M = Integer.parseInt(br.readLine()); int N = Integer.parseInt(br.readLine()); int sum = 0; int min = N+1..

Computer Science (CS)/알고리즘

[백준/Java] 1978번 소수 찾기

문제 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); StringTokenizer st = new StringTokenizer(br.readLine(), " ");; int ..

Computer Science (CS)/알고리즘

[백준/Java] 9506번 약수들의 합

문제 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); while(true){ StringBuilder sb = new StringBuilder(); int n = Integer.parseInt(br.readLine()); if(n == -1) break; sb.append(n + " = 1"); int su..

Computer Science (CS)/알고리즘

[백준/Java] 2501번 약수 구하기

문제 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine(), " "); int N = Integer.parseInt(st.nextToken()); int ..

Computer Science (CS)/알고리즘

[백준/Java] 5086번 배수와 약수

문제 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; while(true){ st = new StringTokenizer(br.readLine()); int x = Integer.parseInt(st.nextTo..

Computer Science (CS)/알고리즘

[백준/Java] 10757번 큰 수 A+B

문제 정답 풀이 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine(), " "); // 값을 받아서 String strA = st.nextToken(); String..

eune7
'Computer Science (CS)' 카테고리의 글 목록 (4 Page)