본문 바로가기

Problem Solving/Baekjoon1338

[백준] 6179 Oh Those Rollers - Graph Theory / Java • 문제 링크 6179번: Oh Those Rollers Farmer John has installed a new winch that gives him mechanical advantage when lifting bales of hay into the barn. The winch was manufactured by the Rube Goldberg Winch Company and has way too many rollers to make any sense at all. The winch has a huge ste www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStrea.. 2024. 3. 6.
[백준] 10451 순열 사이클 - Graph Theory / Java • 문제 링크 10451번: 순열 사이클 1부터 N까지 정수 N개로 이루어진 순열을 나타내는 방법은 여러 가지가 있다. 예를 들어, 8개의 수로 이루어진 순열 (3, 2, 7, 8, 1, 4, 5, 6)을 배열을 이용해 표현하면 \(\begin{pmatrix} 1 & 2 &3&4&5&6&7&8 \\ 3 www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter; public class Main { static int[] arr; static boolean[] visit; public static void main(String[] args) throws IO.. 2024. 3. 5.
[백준] 9897 Lamp - Data Structure / Java • 문제 링크 9897번: Lamp A building has a long corridor and L ceiling lamps labeled 1, 2, 3, ..., L. Each lamp has an individual switch that can turn the lamp on or off. The building manager hires G security guards (no two guards have the same name), whose job at night is to www.acmicpc.net • 풀이 코드 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.i.. 2024. 3. 4.
[백준] 6325 Definite Values - Data Structure / Java • 문제 링크 6325번: Definite Values Assume that before the execution of the given program part, variable a has some definite value, while all other variables are undefined. You have to print the names of the variables which have a definite value after the execution of the program part. More www.acmicpc.net • 풀이 코드 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOExceptio.. 2024. 3. 3.
[백준] 6474 Palindromes - Data Structure / Java • 문제 링크 6474번: Palindromes A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string "ABCDEDCBA" is a palindrome because it is the same when the string is read from left to right as when the string is read from right to le www.acmicpc.net • 풀이 코드 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; im.. 2024. 3. 2.
[백준] 4675 Word Amalgamation - Data Structure / Java • 문제 링크 4675번: Word Amalgamation The input file contains four parts: 1) a dictionary, which consists of at least one and at most 100 words, one per line; 2) a line containing XXXXXX, which signals the end of the dictionary; 3) one or more scrambled 'words' that you must unscramble, each o www.acmicpc.net • 풀이 코드 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOExcep.. 2024. 3. 1.