일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- type challenge
- javascript
- dp
- 레벨 1
- 프로그래머스
- HTTP
- 타입스크립트
- ip
- Algorithm
- 알고리즘
- 타입 챌린지
- 그래프
- Nestjs
- 가천대
- HTTP 완벽 가이드
- 쉬운 문제
- 자바스크립트
- dfs
- 프로그래머스 레벨 2
- 크롤링
- Node.js
- typescript
- BFS
- Crawling
- TCP
- 소켓
- 문자열
- socket
- 백준
- 수학
- Today
- Total
목록알고리즘 (82)
kakasoo
const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const graph = []; let [N, M] = [0, 0]; rl.on("line", (line) => { if (!N) { [N, M] = line.split(" ").map(Number); } else { graph.push(line.split(" ").map(Number)); if (graph.length === N) { main(); process.exit(); } } }); const main = () => { let visited = []; const xMove ..
const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const graph = []; let N, M; rl.on("line", (line) => { if (!N) { [N, M] = line.split(" ").map(Number); } else { const row = line.split(" ").map(Number); graph.push(row); if (graph.length === N) { rl.close(); } } }).on("close", () => { const visited = []; for (let i = 0; i ..
// 백준 2178번 미로 탐색을 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); let input = []; let N = 0; let M = 0; rl.on("line", (line) => { if (!N) { [N, M] = line.split(" ").map(Number); } else { input.push(line); if (input.length === N) { main(); process.exit(); } } }); const main = () => { const graph = []; const visi..
kscodebase.tistory.com/394 이전 문제에 JavaScript에 대한 단점들을 조금 나열했는데, 나름대로 깔끔하게 고쳐보고자 이번에는 중첩된 함수 구조를 사용했다. // 백준 11724번 연결요소의 게수를 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; let N = 0; let M = 0; rl.on("line", (line) => { if (!N) { [N, M] = line.split(" ").map(Number); } else { input.push(line);..
// 백준 1260번 DFS와 BFS를 풀었습니다. const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); const input = []; let n = 0; let m = 0; let start = 0; rl.on("line", (line) => { if (!n) { [n, m, start] = line.split(" ").map(Number); } else { input.push(line); if (input.length === m) { main(); process.exit(); } } }); const dfs = (start) =>..
const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); rl.on("line", (line) => { main(Number(line)); rl.close(); }).on("close", () => { process.exit(); }); /** * * @param {number} line */ const main = (line) => { const DP = new Array(line + 1).fill(0); DP[2] = 3; for (let i = 4; i
const readline = require("readline"); const input = []; let count = 0; const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); rl.on("line", (line) => { if (!count) { count = 3 * line; } else { input.push(line); if (input.length % 3 === 0) { main(); } if (input.length === count) { rl.close(); } } }).on("close", () => { process.exit(); }); const main = () => { cons..
const readline = require("readline"); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); rl.on("line", (line) => { main(line); rl.close(); }).on("close", () => { process.exit(); }); const main = (line) => { line = Number(line); const DP = new Array(line + 1).fill(0); DP[1] = 1; DP[2] = 3; for (let i = 3; i
여기에 작성된 코드는 절대로 좋은 코드가 아니니, 참고하지 말 것! 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 #include #include using namespace std; /* 1232123 이라는 숫자가 있다고 할 때, 기준점을 하나씩 옮겨가며, 양측의 숫자들이 동일..
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 #include #include #include using namespace std; char arr[15]; bool visited[15]; int l, c; int moum; int jaum; vector str; void dfs(int cur, int start) { if (cur == l && moum >= 1 && jaum >= 2) { for (int i = 0; i
알고리즘에 대해 알고리즘을 배우기 전에 대부분의 사람들이 궁금한 것이, 수학적인 능력의 유무가 알고리즘을 배우는 데에 필수적인지 일 것이다. 나도 어렴풋이 그런 걸 느끼기도 했고, 경험해가며 굳이 필요없다는 것을 느꼈다. 인공지능을 한다거나, 아니면 그래픽스를 할 게 아니라면 필요없다는 것을 이해할 수 있었다. 비록 내가 인공지능이나 그래픽스를 해본 것은 아니지만, 수식을 쓰는가 안 쓰는가, 그런 도구적인 쓰임과 자신이 사용하는 공식들에 대한 이해 없이 그저 수학적 사고력만으로 풀 수 있는 문제들 선이 내게 필요한 cut line 이었기 때문이다. 그 이상으로 가려면 아직 시간도 많고, 필요할 때 배워도 문제 없겠다고 싶었다. (Q. 나는 하루에 8시간 정도 code를 짜고 있는데, 필요할 때 배워도 문..
문제가, 솔직히 알고리즘이라고 하기도 애매한 것들 (정의로는 물론 다 알고리즘이겠지만), 그런 것들은 그냥 다 분류를 '수학'이라고 해버리는 감이... 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 32 33 34 35 #include using namespace std; int arr[100000]; int main(void) { int n; cin >> n; for (int i = 0; i > temp; if (temp == 0) { i--; arr[i] = 0; i--; n--; n--; } else { arr[i] = temp; } } int sum = 0; for (int i = 0; i