본문 바로가기

Problem Solving1233

[백준] 9882 Balanced Teams - Backtracking / Java • 문제 링크 9882번: Balanced Teams Output Details One possible solution is to divide the teams as follows: (12,1,7), (9,8,3), (10,5,4), and (11,2,6). The first two have skill 20 and the second two have skill 19. www.acmicpc.net • 풀이 과정 • 풀이 코드 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; .. 2023. 6. 8.
[백준] 14534 String Permutation - Backtracking / Java • 문제 링크 14534번: String Permutation First line of the input contains T (1 ≤ T ≤ 200), the number of test cases. For each test case, there will a string of characters, L (1 ≤ L ≤ 5). 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.. 2023. 6. 8.
[백준] 6211 The Eating Puzzle - Backtracking / Java • 문제 링크 6211번: The Eating Puzzle Bessie is on a diet where she can eat no more than C (10 2023. 6. 6.
[백준] 18270 Livestock Lineup - Backtracking / Java • 문제 링크 18270번: Livestock Lineup Every day, Farmer John milks his 8 dairy cows, named Bessie, Buttercup, Belinda, Beatrice, Bella, Blue, Betsy, and Sue. The cows are rather picky, unfortunately, and require that Farmer John milks them in an order that respects $N$ constraints ($1 \leq N \ www.acmicpc.net • 풀이 과정 • 풀이 코드 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.. 2023. 6. 5.
[백준] 16771 Back and Forth - Backtracking / Java • 문제 링크 16771번: Back and Forth The first line of input contains $10$ integers, giving the sizes of the buckets initially at the first barn. The second line of input contains $10$ more integers, giving the sizes of the buckets initially at the second barn. All bucket sizes are in the ran www.acmicpc.net • 풀이 과정 • 풀이 코드 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.I.. 2023. 6. 4.
[백준] 14912 숫자 빈도수 - Brute Force / Java • 문제 링크 14912번: 숫자 빈도수 자연수 n (1 ≤ n ≤ 100,000)과 한 자리 숫자 d(0~9)가 첫째 줄에 주어진다. www.acmicpc.net • 풀이 과정 • 풀이 코드 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.StringTokenizer; public class Main { static int cnt, d; public static void main(String[] args) throws IOException .. 2023. 6. 3.