전체 글(259)
-
[백준] 9063번 대지 Java 문제 풀이
문제풀이 import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; interface Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); StringTokenizer st; int N = Integer.parseInt(br.readLine()); int minX = 10000, minY = 10000, maxX = -10000, maxY = -100..
2023.03.21 -
[백준] 15894번 수학은 체육과목 입니다 Java 문제 풀이
문제풀이 import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; interface Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); StringTokenizer st; long n = Long.parseLong(br.readLine()); System.out.println(n * 4); } } 가장 아랫부분의 정사각형의 갯수 n은 10⁹까지이므..
2023.03.21 -
[백준] 27323번 직사각형 Java 문제 풀이
문제풀이 import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; interface Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); StringTokenizer st; int A = Integer.parseInt(br.readLine()), B = Integer.parseInt(br.readLine()); System.out.println(A ..
2023.03.20 -
[백준] 9506번 약수들의 합 Java 문제 풀이
문제풀이 import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; interface Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); StringTokenizer st; int n = Integer.parseInt(br.readLine()), sum = 0; while(n != -1) { sb.setLength(0); sb.append(n + "..
2023.03.20 -
[백준] 2501번 약수 구하기 Java 문제 풀이
문제풀이 import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; interface Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); StringTokenizer st; int[] input = Arrays.stream(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray(); int N ..
2023.03.20 -
[백준] 5086번 배수와 약수 Java 문제 풀이
문제풀이 import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; interface Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); StringTokenizer st; int[] input = Arrays.stream(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray(); while(..
2023.03.20