From 947cd4a91cb26a4459dec625bb146c5e7928fab7 Mon Sep 17 00:00:00 2001 From: songyc macbook Date: Tue, 2 Dec 2025 21:23:10 +0900 Subject: [PATCH] baekjoon 20251202 --- code_study/Baekjoon/ts/2623.ts | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 code_study/Baekjoon/ts/2623.ts diff --git a/code_study/Baekjoon/ts/2623.ts b/code_study/Baekjoon/ts/2623.ts new file mode 100644 index 0000000..d811832 --- /dev/null +++ b/code_study/Baekjoon/ts/2623.ts @@ -0,0 +1,34 @@ +export {}; + +const input = require("fs").readFileSync(0).toString().trim().split('\n'); +const [N, M]: number[] = input[0].split(" ").map(Number); + +let graph: number[][] = Array.from({length: N+1}, () => []); +let inDegree: number[] = new Array(N+1).fill(0); +for(let i=1; i<=M; i++) { + const line: number[] = input[i].split(" ").map(Number); + + for(let j=1; j