Skip to content

Commit

Permalink
WIP: dp(서울에서 경산까지)
Browse files Browse the repository at this point in the history
  • Loading branch information
luckylooky2 committed Jul 22, 2024
1 parent 08e2f53 commit 9ac0303
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions baekjoon/14863(WIP).js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// 서울에서 경산까지
const input = require("fs")
.readFileSync("/dev/stdin")
.toString()
.trim()
.split("\n")
.map((v) => v.split(" ").map((v) => Number(v)));
const [cityCnt, maxMinute] = input.shift();
const [WALK, RIDE] = [0, 1];
// table[cityIndex][WALK | RIDE]
const table = input.map(([a, b, c, d]) => [
[a, b],
[c, d],
]);
const dp = new Array(cityCnt + 1)
.fill(null)
.map(() => new Array(maxMinute + 1).fill(null));

0 comments on commit 9ac0303

Please sign in to comment.