Problem Solving1242 [백준] 9255 The Friend of My Enemy is My Enemy - Graph Theory / Java • 문제 링크 9255번: The Friend of My Enemy is My Enemy For each data set, output “Data Set x:” on a line by itself, where x is its number. Then, output on one line all the direct friends of person s in the network, sorted in increasing order, separated by a space. (No person is friends with himself/herself www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java... 2024. 1. 6. [백준] 6601 Knight Moves - Graph Theory / Java • 문제 링크 6601번: Knight Moves A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each square of a given set of n squares on a chessboard exactly once. He thinks that the most difficult part www.acmicpc.net • 풀이 코드 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; .. 2024. 1. 5. [백준] 8975 PJESMA - Data Structure / Java • 문제 링크 8975번: PJESMA "Guess the song" is a popular game among young programmers in Croatia. It is a game of skill, wisdom and patience. The game host plays a song so that all players hear it. The players' goal is to guess the title of the song as fast as possible. Mirko may www.acmicpc.net • 풀이 코드 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import j.. 2024. 1. 4. [백준] 9843 LVM - Data Structure / Java • 문제 링크 9843번: LVM The first line of the input contains an integer n between 2 and 1000, indicating the number of instructions of the program. The following n lines contain the program instructions. Arguments are separated by a space character from the preceding instruction. www.acmicpc.net • 풀이 코드 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import j.. 2024. 1. 3. [백준] 6119 Cow Line - Data Structure / Java • 문제 링크 6119번: Cow Line Farmer John's N cows (conveniently numbered 1..N) are forming a line. The line begins with no cows and then, as time progresses, one by one, the cows join the line on the left or right side. Every once in a while, some number of cows on the left or right s www.acmicpc.net • 풀이 코드 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; imp.. 2024. 1. 2. [백준] 2371 파일 구별하기 - Data Structure / Java • 문제 링크 2371번: 파일 구별하기 메모리에 N개의 파일이 저장되어 있다. 이 문제에서는 편의상 각각의 파일을 수열과 같이 생각하자. 이와 같은 파일들을 구별하기 위해서는 두 개의 파일을 맨 끝까지 읽어보는 작업을 수행해야 www.acmicpc.net • 풀이 코드 import java.io.BufferedWriter; import java.io.IOException; import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; public class Main { static List lists = new ArrayList.. 2024. 1. 1. 이전 1 ··· 102 103 104 105 106 107 108 ··· 207 다음