목록18513 (1)
-
[BOJ - JAVA] 18513 - 샘터 (BFS, 그래프)
# 주소 https://www.acmicpc.net/problem/18513 18513번: 샘터 첫째 줄에 자연수 N과 K가 공백을 기준으로 구분되어 주어진다. (1 ≤ N, K ≤ 100,000) 둘째 줄에 N개의 샘터의 위치가 공백을 기준으로 구분되어 정수 형태로 주어진다. (-100,000,000 ≤ 샘터의 위치 ≤ www.acmicpc.net # 문제 # 문제 해설 및 코드 리뷰 import java.util.*; class Direction{ int x; int dist; Direction(int x, int dist){ this.x = x; this.dist = dist; } } class Main{ static int n,m; static int[] dx = {-1,1}; static Has..
백준 문제 풀이
2022. 3. 14. 03:58