본문 바로가기

Problem Solving1241

[백준] 14697 방 배정하기 - Brute Force / Java • 문제 링크 14697번: 방 배정하기 정보 초등학교 6학년 여학생들은 단체로 2박 3일 수학여행을 가기로 했다. 학생들이 묵을 숙소에는 방의 정원(방 안에 있는 침대 수)을 기준으로 세 종류의 방이 있으며, 같은 종류의 방들이 여러 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.. 2023. 12. 24.
[백준] 30019 강의실 예약 시스템 - Greedy / Java • 문제 링크 30019번: 강의실 예약 시스템 충남대학교 공대 5호관에는 $1$번부터 $N$번까지 번호가 매겨진 $N$개의 강의실이 있다. 학생들은 강의실 예약 시스템을 통해 원하는 강의실을 예약한 후에 이용할 수 있다. 강의실을 예약하기 위 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(S.. 2023. 12. 23.
[백준] 11968 High Card Wins - Greedy / Java • 문제 링크 11968번: High Card Wins Bessie the cow is a huge fan of card games, which is quite surprising, given her lack of opposable thumbs. Unfortunately, none of the other cows in the herd are good opponents. They are so bad, in fact, that they always play in a completely predictable fas www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStream.. 2023. 12. 22.
[백준] 16406 Exam - Greedy / Java • 문제 링크 16406번: Exam Your friend and you took the same true/false exam. You know your answers, your friend’s answers, and the number of your friend’s answers that were correct. Compute the maximum possible score you could have gotten www.acmicpc.net • 풀이 코드 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.O.. 2023. 12. 21.
[백준] 20974 Even More Odd Photos - Greedy / Java • 문제 링크 20974번: Even More Odd Photos In this example, one way to form the maximum number of five groups is as follows. Place 2 in the first group, 11 in the second group, 13 and 1 in the third group, 15 in the fourth group, and 17 and 3 in the fifth group. www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter; public class Main { pub.. 2023. 12. 20.
[백준] 15761 Lemonade Line - Greedy / Java • 문제 링크 15761번: Lemonade Line It's a hot summer day out on the farm, and Farmer John is serving lemonade to his $N$ cows! All $N$ cows (conveniently numbered $1 \dots N$) like lemonade, but some of them like it more than others. In particular, cow $i$ is willing to wait in a line behin www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamW.. 2023. 12. 19.