https://www.acmicpc.net/problem/4991 4991번: 로봇 청소기 각각의 테스트 케이스마다 더러운 칸을 모두 깨끗한 칸으로 바꾸는 이동 횟수의 최솟값을 한 줄에 하나씩 출력한다. 만약, 방문할 수 없는 더러운 칸이 존재하는 경우에는 -1을 출력한다. www.acmicpc.net class Node { constructor(item) { this.item = item; this.next = null; } } class Queue { constructor() { this.head = null; this.tail = null; this.length = 0; } push(item) { const node = new Node(item); if (this.head == null) { thi..
https://www.acmicpc.net/problem/23288 23288번: 주사위 굴리기 2 크기가 N×M인 지도가 존재한다. 지도의 오른쪽은 동쪽, 위쪽은 북쪽이다. 지도의 좌표는 (r, c)로 나타내며, r는 북쪽으로부터 떨어진 칸의 개수, c는 서쪽으로부터 떨어진 칸의 개수이다. 가장 왼 www.acmicpc.net class Node { constructor(item) { this.item = item; this.next = null; } } class Queue { constructor() { this.head = null; this.tail = null; this.length = 0; } push(item) { const node = new Node(item); if (this.head..
https://www.acmicpc.net/problem/2931 2931번: 가스관 www.acmicpc.net class Node { constructor(item) { this.item = item; this.next = null; } } class Queue { constructor() { this.head = null; this.tail = null; this.length = 0; } push(item) { const node = new Node(item); if (this.head == null) { this.head = node; } else { this.tail.next = node; } this.tail = node; this.length += 1; } pop() { const popIt..
https://www.acmicpc.net/problem/1005 1005번: ACM Craft 첫째 줄에는 테스트케이스의 개수 T가 주어진다. 각 테스트 케이스는 다음과 같이 주어진다. 첫째 줄에 건물의 개수 N과 건물간의 건설순서 규칙의 총 개수 K이 주어진다. (건물의 번호는 1번부 www.acmicpc.net 골드 3단계 문제인데, Node로 풀면 골드3문제는 아닌 거 같다. 다른 언어로는 그냥 위상정렬로 통과하는데, Node에서는 시간초과 때문에 dfs + dp 로 푼 사람이 많았다. 나도 처음에는 단순히 위상정렬로 풀었는데 시간초과가 나서 입력방식을 fs 에서 readline으로 바꾸고, input값을 Array말고 Queue에 담아서 푸니까 통과했다. 다들 dp로 열심히 풀었는데, 나만 입력..
https://www.acmicpc.net/problem/1520 1520번: 내리막 길 여행을 떠난 세준이는 지도를 하나 구하였다. 이 지도는 아래 그림과 같이 직사각형 모양이며 여러 칸으로 나뉘어져 있다. 한 칸은 한 지점을 나타내는데 각 칸에는 그 지점의 높이가 쓰여 있으 www.acmicpc.net const input = require('fs') .readFileSync('./dev/stdin') .toString() .trim() .split('\n') .map((v) => v.split(' ').map(Number)); const [N, M] = input.shift(); const dp = Array.from(Array(N), () => Array(M).fill(-1)); dp[N - 1]..
https://www.acmicpc.net/problem/1022 1022번: 소용돌이 예쁘게 출력하기 첫째 줄에 네 정수 r1, c1, r2, c2가 주어진다. www.acmicpc.net const [r1, c1, r2, c2] = require('fs') .readFileSync('./dev/stdin') .toString() .trim() .split(' ') .map((v) => +v); const w = r2 - r1; const h = c2 - c1; let answer = Array.from(Array(w + 1), () => Array(h + 1)); const dx = [0, -1, 0, 1]; const dy = [1, 0, -1, 0]; let dir = 0; let x = 0; l..
https://www.acmicpc.net/problem/20058 20058번: 마법사 상어와 파이어스톰 마법사 상어는 파이어볼과 토네이도를 조합해 파이어스톰을 시전할 수 있다. 오늘은 파이어스톰을 크기가 2N × 2N인 격자로 나누어진 얼음판에서 연습하려고 한다. 위치 (r, c)는 격자의 r행 c www.acmicpc.net class Node { constructor(item) { this.item = item; this.next = null; } } class Queue { constructor() { this.head = null; this.tail = null; this.length = 0; } push(item) { const node = new Node(item); if (this.hea..

https://www.acmicpc.net/problem/15898 15898번: 피아의 아틀리에 ~신비한 대회의 연금술사~ "피아의 아틀리에 ~신비한 대회의 연금술사~"는 가난한 연금술사 피아의 성장스토리를 담은 게임이다. 이 게임의 가장 중요한 부분은 "대회"인데, 연금술로 높은 품질의 물건을 만들어 상금을 타 www.acmicpc.net Node로 푼 게 시간초과로 정답이 인정되지 않아서 C로 풀었다. 전에 코틀린 한다고 좀 까불었는데, 코틀린으로 푼다고 풀릴지 의문이라 일단 C로 풀었다. C로 문제를 푼 게 정말 오랜만이라 문법이 하나도 기억이 안 나서 구조체부터 다시 찾아보면서 풀었다. 코드는 엄청 구리다ㅋ #include typedef struct item { char color; int nu..
- Total
- Today
- Yesterday
- 그래프
- 은둔청년체험
- 롱베케이션
- create databases;
- create db
- 서버점검
- 투포인터 연습
- DB 생성
- 다이나믹프로그래밍
- node.js
- BFS
- 동적프로그래밍
- 다이나밍프로그래밍
- 서버개발
- MySQL
- 투포인터
- 개발자면접
- 면접질문
- MOD
- 면접비
- 로드나인
- 최소공통조상
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |