본문 바로가기

Problem Solving1237

[백준] 13702 이상한 술집 - BinarySearch / Java • 문제 링크 13702번: 이상한 술집 프로그래밍 대회 전날, 은상과 친구들은 이상한 술집에 모였다. 이 술집에서 막걸리를 시키면 주전자의 용량은 똑같았으나 안에 들어 있는 막걸리 용량은 랜덤이다. 즉 한 번 주문에 막걸리 용 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.. 2023. 8. 10.
[백준] 18265 MooBuzz - BinarySearch / Java • 문제 링크 18265번: MooBuzz Farmer John's cows have recently become fans of playing a simple number game called "FizzBuzz". The rules of the game are simple: standing in a circle, the cows sequentially count upward from one, each cow saying a single number when it is her turn. If a c www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter;.. 2023. 8. 9.
[백준] 1072 게임 - BinarySearch / Java • 문제 링크 1072번: 게임 김형택은 지금 몰래 Spider Solitaire(스파이더 카드놀이)를 하고 있다. 형택이는 이 게임을 이길 때도 있었지만, 질 때도 있었다. 누군가의 시선이 느껴진 형택이는 게임을 중단하고 코딩을 하기 시 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(Syst.. 2023. 8. 8.
[백준] 15092 Sheba’s Amoebas - Graph Theory / Java • 문제 링크 15092번: Sheba’s Amoebas The first line of input contains two integers m and n, (1 ≤ m, n ≤ 100). This is followed by m lines, each containing n characters. A ‘#’ denotes a black pixel, a ‘.’ denotes a white pixel. For every black pixel, exactly two of its eight neighb www.acmicpc.net • 풀이 코드 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import .. 2023. 8. 7.
[백준] 14397 해변 - Graph Theory / Java • 문제 링크 14397번: 해변 단위 정육각형 이루어져 있는 지도가 주어졌을 때, 해변의 길이를 구하는 프로그램을 작성하시오. 해변은 정육각형의 변 중에서 한 쪽은 물인데, 한 쪽은 땅인 곳을 의미한다. www.acmicpc.net • 풀이 코드 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; public class Main { static int n, m; static char[][] arr; static int[] dy = {-1, -1, 0, 0, 1, 1}, dx.. 2023. 8. 6.
[백준] 27737 버섯 농장 - Graph Theory / Java • 문제 링크 27737번: 버섯 농장 첫 번째 줄에 $N$, $M$, $K$가 공백으로 구분되어 주어진다. 두 번째 줄부터 $N$개의 줄에 나무판의 각 칸의 상태가 공백으로 구분되어 주어진다. 버섯이 자랄 수 있는 칸은 0, 버섯이 자랄 수 없는 칸 www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter; import java.util.LinkedList; import java.util.Queue; public class Main { static int n, m, k; static int[][] arr; static int[] dy = {-1, 1, .. 2023. 8. 5.