본문 바로가기

Problem Solving1244

[백준] 7515 Prehistoric Operating Systems - Dynamic Programming / Java • 문제 링크 7515번: Prehistoric Operating Systems It is the year 2254. Ohio Smith is a specialist in dealing with ancient operating systems. For research purposes, he tries to install several operating systems on his computer which were used about 250 years ago. Prior research has yielded the result that www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java.io.. 2024. 2. 19.
[백준] 26948 Plankan - Dynamic Programming / Java • 문제 링크 26948번: Plankan Man vill skapa en längre planka med hjälp av ett antal mindre brädor. Det finns tre olika typer av brädor, som har längden $1$, $2$ respektive $3$ meter. Det finns ett obegränsat antal av varje typ. Det finns $7$ sätt att limma ihop en planka som ä www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter; public .. 2024. 2. 18.
[백준] 8582 Park - Dynamic Programming / Java • 문제 링크 8582번: Park W pierwszym wierszu standardowego wejścia znajduje się jedna liczba całkowita $n$ ($1 ≤ n ≤ 1\,000\,000$) oznaczająca długość pasma górskiego. W każdym z następnych $n$ wierszy znajduje się po jednej liczbie całkowitej $w_i$ ($1≤ w_i www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter; public class Main { public.. 2024. 2. 17.
[백준] 6092 Strange Towers of Hanoi - Dynamic Programming / Java • 문제 링크 6092번: Strange Towers of Hanoi Charlie Darkbrown sits in another one of those boring Computer Science lessons: At the moment the teacher just explains the standard Tower of Hanoi problem, which bores Charlie to death! Figure 4: The standard (three) Towers of Hanoi. The teacher points www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputS.. 2024. 2. 16.
[백준] 25972 도미노 무너트리기 - Greedy / Java • 문제 링크 25972번: 도미노 무너트리기 미야노는 $N$개의 도미노를 가지고 놀고 있다. 각각의 도미노는 1차원 좌표계의 $x$좌표 위에 위치하고 있고 길이를 가진다. $i$번째 도미노의 $x$좌표를 $a_i$, 길이를 $l_i$라 하자. 도미노는 오른쪽 www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter; import java.util.Arrays; public class Main { public static void main(String[] args) throws IOException { BufferedWriter bw = new Buffe.. 2024. 2. 15.
[백준] 16237 이삿짐센터 - Greedy / Java • 문제 링크 16237번: 이삿짐센터 첫째 줄에 A, B, C, D, E가 주어진다. (0 ≤ A, B, C, D, E ≤ 1,000) www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter; public class Main { public static void main(String[] args) throws IOException { BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int a = read(), b = read(), c = read(), d = rea.. 2024. 2. 14.