https://www.acmicpc.net/problem/2630 2630번: 색종이 만들기 첫째 줄에는 전체 종이의 한 변의 길이 N이 주어져 있다. N은 2, 4, 8, 16, 32, 64, 128 중 하나이다. 색종이의 각 가로줄의 정사각형칸들의 색이 윗줄부터 차례로 둘째 줄부터 마지막 줄까지 주어진다. www.acmicpc.net 큐로 풀었음 const fs = require('fs'); const [n,...arr] = fs.readFileSync("./dev/stdin").toString().trim().split("\n"); const N = +n const board = arr.map(v=>v.split(' ').map(v=>+v)) class Node{ constructor(item){ ..
https://www.acmicpc.net/problem/5430 5430번: AC 각 테스트 케이스에 대해서, 입력으로 주어진 정수 배열에 함수를 수행한 결과를 출력한다. 만약, 에러가 발생한 경우에는 error를 출력한다. www.acmicpc.net const fs = require('fs'); const [n, ...arr] = fs.readFileSync("./dev/stdin").toString().trim().split("\n"); const N = +n; class Node { constructor(item) { this.item = item; this.prev = null; this.next = null; } } class Deque { constructor() { this.head = ..
https://www.acmicpc.net/problem/1021 1021번: 회전하는 큐 첫째 줄에 큐의 크기 N과 뽑아내려고 하는 수의 개수 M이 주어진다. N은 50보다 작거나 같은 자연수이고, M은 N보다 작거나 같은 자연수이다. 둘째 줄에는 지민이가 뽑아내려고 하는 수의 위치가 www.acmicpc.net 어떤 경우에 앞에서 뒤로 보내야되는지, 뒤에서 앞으로 보내야되는지 잘 모르는데 뽀록으로 맞춤. deque.size()+1>=2*position[0] 이부분 예제 테스트케이스 없었으면 못 맞췄을 듯 . 다시 공부 필요함. const fs = require('fs'); const [a,b] = fs.readFileSync("./dev/stdin").toString().trim().split("\n..
class Node{ constructor(item){ this.item = item; this.prev = null; this.next = null; } } class Deque{ constructor(){ this.head = null; this.tail = null; this.length = 0; } push_front(item){ const node = new Node(item); if(this.size()==0){ this.head = node; this.tail = node; }else{ this.head.prev = node; node.next=this.head; this.head = node; } this.length+=1; } push_back(item){ const node = new ..
https://www.acmicpc.net/problem/10866 10866번: 덱 첫째 줄에 주어지는 명령의 수 N (1 ≤ N ≤ 10,000)이 주어진다. 둘째 줄부터 N개의 줄에는 명령이 하나씩 주어진다. 주어지는 정수는 1보다 크거나 같고, 100,000보다 작거나 같다. 문제에 나와있지 www.acmicpc.net const fs = require('fs'); const [n, ...arr] = fs.readFileSync("./dev/stdin").toString().trim().split("\n"); class Node{ constructor(item){ this.item = item; this.prev = null; this.next = null; } } class Deque{ cons..
https://www.acmicpc.net/problem/1966 1966번: 프린터 큐 여러분도 알다시피 여러분의 프린터 기기는 여러분이 인쇄하고자 하는 문서를 인쇄 명령을 받은 ‘순서대로’, 즉 먼저 요청된 것을 먼저 인쇄한다. 여러 개의 문서가 쌓인다면 Queue 자료구조에 www.acmicpc.net const fs = require('fs'); const [n, ...arr] = fs.readFileSync("./dev/stdin").toString().trim().split("\n"); const N = +n; const docs =[]; for(let i = 0; i{ const [num,target,priority] = v; let q = new Queue(); let priorityArr..
https://www.acmicpc.net/problem/11866 11866번: 요세푸스 문제 0 첫째 줄에 N과 K가 빈 칸을 사이에 두고 순서대로 주어진다. (1 ≤ K ≤ N ≤ 1,000) www.acmicpc.net const fs = require('fs'); const [N,K] = fs.readFileSync("./dev/stdin").toString().trim().split(" ").map(v=>+v); class Node{ constructor(item){ this.item = item; this.next = null; } } class Queue{ constructor(){ this.head = null; this.tail = null; this.length = 0; } push(..
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 popItem = this.head; this.head = this.head.next; this.length -=1; return popItem.ite..
- Total
- Today
- Yesterday
- 서버점검
- 개발자면접
- 면접비
- 투포인터 연습
- 동적프로그래밍
- 그래프
- BFS
- DB 생성
- 다이나밍프로그래밍
- node.js
- create databases;
- 면접질문
- 은둔청년체험
- 롱베케이션
- 서버개발
- 투포인터
- create db
- 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 |