목록javascript (1)
HIT해

https://www.acmicpc.net/problem/2667 2667번: 단지번호붙이기 과 같이 정사각형 모양의 지도가 있다. 1은 집이 있는 곳을, 0은 집이 없는 곳을 나타낸다. 철수는 이 지도를 가지고 연결된 집의 모임인 단지를 정의하고, 단지에 번호를 붙이려 한다. 여 www.acmicpc.net BFS를 활용해 풀이한 문제다. 연결되어있는 단지의 길이와 갯수를 출력한다. const filePath = process.platform === 'linux' ? '/dev/stdin' : 'input.txt'; const [n,...input] = require("fs") .readFileSync(filePath) .toString() .trim().split('\n'); const N = Num..
Vue/JavaScript 알고리즘
2024. 1. 10. 23:44