Problem Solving/Baekjoon1335 [백준] 19592 장난감 경주 - BinarySearch / Java • 문제 링크 19592번: 장난감 경주 당신을 포함한 N명의 참가자가 각자 자신의 장난감 자동차를 이용해 경주를 하는데, 트랙의 길이는 X 미터이다. 참가자는 1번부터 N번까지 번호가 매겨져 있고, 당신의 참가 번호는 N번이다. i번 www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter; public class Main { static int n, x, y; public static void main(String[] args) throws IOException { BufferedWriter bw = new BufferedWriter(new Outpu.. 2023. 8. 12. [백준] 17124 두 개의 배열 - BinarySearch / Java • 문제 링크 17124번: 두 개의 배열 정수 배열 A 와 B가 있다. A는 총 n개의 서로 다른 양의 정수를 포함하고 B는 총 m개의 서로 다른 양의 정수를 포함한다. A, B를 이용해서 길이가 n인 새로운 배열 C를 만들어보자. C[i] 는 배열 B에 있 www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter; import java.util.Arrays; public class Main { static int[] a, b; public static void main(String[] args) throws IOException { BufferedWr.. 2023. 8. 11. [백준] 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. 이전 1 ··· 142 143 144 145 146 147 148 ··· 223 다음